git checkout 撤销修改回到最近一次git commit或git add时的状态
[root@localhost 222]# cat aaa (显示)
bbb
ccc
[root@localhost 222]# vim aaa (修改)
[root@localhost 222]# cat aaa (显示)
ccc
[root@localhost 222]# git checkout aaa (撤回修改到工作区)
从索引区更新了 1 个路径
[root@localhost 222]# cat aaa (显示)
bbb
ccc
[root@localhost 222]# vim aaa (修改)
[root@localhost 222]# cat aaa (显示)
bbb
ccc
ddd
[root@localhost 222]# git add aaa (添加到暂存区)
[root@localhost 222]# vim aaa (修改)
[root@localhost 222]# cat aaa (显示)
bbb
[root@localhost 222]# git checkout aaa (撤销修改回到暂存区)
从索引区更新了 1 个路径
[root@localhost 222]# cat aaa (显示)
bbb
ccc
ddd
[root@localhost 222]#
[root@localhost 222]# git commit -m hahahh
[devd 26260b8] hahahh
1 file changed, 1 insertion(+)
[root@localhost 222]# vim aaa
[root@localhost 222]# cat aaa
bbb
ccc
ddd
eee
[root@localhost 222]# git checkout aaa
从索引区更新了 1 个路径
[root@localhost 222]# cat aaa
bbb
ccc
ddd
[root@localhost 222]#