git rebase後丟失本地commit記錄
阿新 • • 發佈:2018-12-15
、
在git rebase操作時,存在衝突時,使用git rebase --abort處理後,結果發現commit的修改和記錄都沒有了。(使用git rebase --skip處理,也有導致commit消失不見得情況),就是使用git log看不到。
並不是真的在git中完全消失了。
這是可以使用reflog命令列出log 資訊。 reflog : reference logs
$ git reflog d185b35 [email protected]{0}: rebase finished: returning to refs/heads/passport d185b35 [email protected]
$git checkout -b branch-bak [commit-sha] 然後可以出來衝突,再git add, git commit, git push等操作,把修改提交。 --------------------- ref: