Abort (random and old / dangling) permutation, but save all changes

I work locally on a branch (master). I used to do a rerun to crush some commits that I thought worked. I continued to make a number of commits until I needed to do another reboot. When I called git rebase -i HEAD~3 , I got an error:

Interactive reboot is already running

assuming i never finished the old reboot.

Now I want to abort the old rebase without losing any of my changes from the start. I was going to use

 git rebase --abort 

but I'm sure that it will delete all my local commits and will be back before the reboot. What can i do here?

+4
source share
1 answer

Lock them. Abort the permutation. Pull commit from git reflog .

 git add . git commit -m "Rebased changes" git rebase --abort git cherry-pick HEAD@ {1} 

Do what you want with this. If your git reflog expired (I can’t imagine the situation when this happens in normal everyday operations), cut a new branch and then abort rebase:

 git add . git commit -m "Rebase changes" git checkout -b rebased-master git rebase --abort 
+4
source

All Articles