Undoing a git rebase

前端 未结 18 1432
孤城傲影
孤城傲影 2020-11-22 02:41

Does anybody know how to easily undo a git rebase?

The only way that comes to mind is to go at it manually:

  • git checkout the commit parent to both of t
18条回答
  •  臣服心动
    2020-11-22 03:07

    For multiple commits, remember that any commit references all the history leading up to that commit. So in Charles' answer, read "the old commit" as "the newest of the old commits". If you reset to that commit, then all the history leading up to that commit will reappear. This should do what you want.

提交回复
热议问题