After completing a feature branch, during a git rebase -i I accidentally removed all my commits. I’m not completely sure but I suspect that instead of squashing my commits, I replaced the entire entry with a commit message.
http://shafiulazam.com/gitbook/4_interactive_rebasing.html says:
The last useful thing that interactive
rebase can do is drop commits for you.
If instead of choosing ‘pick’,
‘squash’ or ‘edit’ for the commit
line, you simply remove the line, it
will remove the commit from the
history.
My question is: is there a way to revert/undo this?
If you have just done the rebase, you can try as mentioned here:
as Jakub Narębski details:
If you have executed some operations since the rebase, the reflog can still help.