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.txt
commands - Some
git checkout <COMMIT>
commands - One
git status
command - One
git switch -
and onegit switch
command - A final
git checkout master
command.
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?