怎麼回復已經Rebase的Git Repository

Reference : 

1. http://www.atlassian.com/git/tutorials/rewriting-history/git-reflog

2. http://stackoverflow.com/questions/134882/undoing-a-git-rebase


利用git的reflog來找出要回復的commit
$> git reflog
0a2e358 HEAD@{0}: reset: moving to HEAD~2
0254ea7 HEAD@{1}: checkout: moving from 2.2 to master
c10f740 HEAD@{2}: checkout: moving from master to 2.2
如果要回復到HEAD@{1}就執行下面的指令
$> git reset --hard HEAD@{1}

留言

熱門文章