I was going through some 30 files to commit their changes, sorting them into clear commits instead of just pushing everything into one big commit.
After doing some of the commits, I came upon one change that I wanted to merge with a previous commit.
So I made a new commit, and stashed all the rest so that I could do some reorganising. Moved the commit down the tree and then squashed the two commits.
But when I popped the stash, to my surprise I noticed Abort and Continue Rebase buttons. I am not thoroughly familiar with Git, so it often happens I am surprised by its peculiarities. I thought just pressing Continue would be the safest choice and that happened without any errors.
But then I noticed none of the stashed files had been restored, and the stash was gone. All files were in their last committed state. Luckily I still had the most important files open in Visual Studio, which warned me of the external file change, and allowed me to rescue the code in at least those files.
Are all my other edits really gone? I canāt believe it, because I have come to know Git as quite stable with many ways to restore files, but I have found no way to recover my stashed filesā¦
If it helps, here is the list of undo steps that Sublime Merge lists in the Repository menu (up to before I started adding my commits). Though going through them did not restore my lost files.
- rebase
- reset
- amend
- amend
- rebase -i (finish)
- rebase -i (start)
- reset
- commit
- commit
- commit
- commit
- reset
- reset
- commit (ammend)
- commit (ammend)
- commit