Question

I have a local branch work, where I created two new files a.py, b.py and committed them.

Then, instead of doing "git rebase origin/master", I accidently typed "git rebase origin master", and now the commit I did is gone and the files are gone. Does anyone know how I can recover my files?

Was it helpful?

Solution

Undoing a git rebase

Git keeps the old refs (until you clean them up). You can switch back to the old refs from before the rebase just fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top