I was playing around with a project in git and I appear to have lost months of commits.
Here is what I did:
git checkout veryoldcommit
I looked around in the files, found what I needed (didn't make any changes).
I then ran git checkout master
to take me back to the latest commit.
I then wanted to delete only the very latest commit, so following advice here I ran git checkout HEAD-
.
This threw an error, I made a typo. I include here in case it is relevant.
I then ran git checkout HEAD~
(with a tilde this time).
Now, I am stuck at veryoldcommit
and I can't find how to access the newer commits. I'm terrified to touch anything 'cause I'm afraid I'll mess things up more.
I have months of work in that project, and it is not backed up to a remote repository.
What have I done? And, is it fixable?