Undoing a git rebase

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

    I actually put a backup tag on the branch before I do any nontrivial operation (most rebases are trivial, but I'd do that if it looks anywhere complex).

    Then, restoring is as easy as git reset --hard BACKUP.

提交回复
热议问题