Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recover after git rebase --abort

Tags:

git

git-rebase

I started a git rebase in my repository a day ago and never finished it. I forgot about and did a lot of modifications while I was still in the rebase. Today I accidentally did a git rebase --abort without putting those modifications in a commit. Now it looks like all my modifications are gone. Is there any way to recover them?

My git reflog looks like this:

57d731c HEAD@{0}: rebase: aborting
d2d3738 HEAD@{1}: rebase -i (start): checkout david
57d731c HEAD@{2}: commit: My commit message
like image 905
Danvil Avatar asked Apr 25 '16 19:04

Danvil


1 Answers

You can only recover if you have added the content even if you did not commit. But if you did not even added the changes to the staging are you cannot recover those changes unless you use IDE and the IDE has local history of your changes.

git start to track file once they are in the stage area and not while they are untracked.

The local history exists in all the majors IDEs.

like image 161
CodeWizard Avatar answered Sep 27 '22 21:09

CodeWizard