Last Updated: February 25, 2016
·
826
· iiska

Recovering from git rebase accident

Have you lost some commits because of mistakes while doing git rebase?

No worries you wil find reference hashes to your original commits from .git/logs/refs/heads/BRANCH_NAME

After you have found correct hash before rebasing:

git checkout -b my-recovery-branch THAT_HASH

Then you can continue on that new branch, or merge it, or try new rebase etc...