0%

git reflog 查看历史提交记录

救命用的 git reflog(恢复 git reset –hard)

今天不小心手贱没有 push 到 remote 就执行了 git reset –hard xxxx,然后新提交的代码都没了。。。。。
两天的工作量啊!!

在万能的度娘的帮助下找到了 git reflog 这个救命用的命令

1
2
3
dcf7d96 HEAD@{5}: reset: moving to dcf7d96a348faa49e892b4f2d67c2b1dff342b50
402f567 HEAD@{6}: pull origin master: Merge made by the 'recursive' strategy.
eaef723 HEAD@{7}: commit (initial): init project

执行 git reset –hard eaef723 就可以恢复到需要恢复的 commit 了

Welcome to my other publishing channels