我想回去提交一個。我能怎麼做?git如何退回提交
$ git reflog
9b2a45e [email protected]{0}: reset: moving to HEAD~1
0c54f19 [email protected]{1}: reset: moving to HEAD~1
b9c157d [email protected]{2}: commit: updated from online
0c54f19 [email protected]{3}: commit: add img from download folder
9b2a45e [email protected]{4}: commit: add images
6fa6e34 [email protected]{5}: clone: from [email protected]:starpix/dojo.git
$ git reset --hard HEAD~1
HEAD is now at 9b2a45e add images
我想回到「從網上更新」。我怎麼能夠?
復位命令是使用了理想的,所以你仍然可以得到您的分支來跟蹤更改。你可以使用--soft或者--mixed開關來防止你在舞臺或者工作區域跳過變化,否則--hard已經足夠好了 – maxmelbin