Undoing a git rebase

前端 未结 18 1725
孤城傲影
孤城傲影 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:06

    What I usually do is git reset #commit_hash

    to the last commit where I think rebase had no effect.

    then git pull

    Now your branch should match exactly like master and rebased commits should not be in it.

    Now one can just cherry-pick the commits on this branch.

提交回复
热议问题