Undoing a git rebase

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

    Following the solution of @Allan and @Zearin, I wish I could simply do a comment though but I don't enough reputation, so I have used the following command:

    Instead of doing git rebase -i --abort (note the -i) I had to simply do git rebase --abort (without the -i).

    Using both -i and --abort at the same time causes Git to show me a list of usage/options.

    So my previous and current branch status with this solution is:

    matbhz@myPc /my/project/environment (branch-123|REBASE-i)
    $ git rebase --abort
    
    matbhz@myPc /my/project/environment (branch-123)
    $
    

提交回复
热议问题