Reverting an interactive git rebase
在完成了一个功能分支之后,在
http://shafiulazam.com/gitbook/4_interactive_rebasing.html说:
The last useful thing that interactive
rebase can do is drop commits for you.
If instead of choosing 'pick',
'squash' or 'edit' for the commit
line, you simply remove the line, it
will remove the commit from the
history.
我的问题是:是否有方法恢复/撤消此操作?
如果你需要做的只是"rebase,你可以试着在mentioned睾丸: P / < >
1 | git reset --hard ORIG_HEAD |
世纪Jakub NAR吗?bski的细节: P / < >
ORIG_HEAD is previous state ofHEAD , set by commands that have possibly dangerous behavior, to be easy to revert them.
It is less useful now that Git has reflog:HEAD@{1} is roughly equivalent toORIG_HEAD (HEAD@{1} is always last value ofHEAD ,ORIG_HEAD is last value ofHEAD before dangerous operation).
如果你有一些executed运营以来,"rebase,reflog仍然能提供帮助。 P / < >
你可以做"蠢货reflog"和回到你的旧的头。 P / < >