Git – Forgot “git rebase –continue” and did “git commit”. How to fix


I was rebasing code in git, I got some merge conflicts. I resolved the conflicts and did:

git add

At this point I forgot to do:

git rebase --continue

I continued coding and did:

git commit

for the changes. Now I am on "no branch" and can't do:

git rebase --continue 

How do I fix this?

Best Solution

Just do git reset --soft HEAD^. It moves the HEAD pointer to its parent but keeps the work tree and adds the merge change to the index. So you can continue rebasing with git rebase --continue as before.