I have a local git repo where I did some substantial editing to a file file1.txt.
Then I issued a few git commands to look at older versions of this file (and other files). I totally had forgotten that thsi - of course! - would write old veersions to teh same file I just had edited!
The commands I issued are
- Some
git log ...commands - Some
git checkout <COMMIT> file1.txtcommands - Some
git checkout <COMMIT>commands - One
git statuscommand - One
git switch -and onegit switchcommand - A final
git checkout mastercommand.
I don't think any of these commands gave me an warning that they would override my uncommitted changes. (I did however get an info about "detached HEAD mode".)
So I hope there is a chance to get the uncommitted changes back. Does git save uncommited changes somewhere before checking out old versions? Can I retrieve my uncommitted changes?