So I was working on a project and early on I accidentally detached from the Head, but I still kept commit etc. anyway. I then realized I was detached from the head, so I tried to do the following to reattach to the head:
git log -n 1 (I copied the commit)
git checkout master
git branch (long hash I copied)
git merge tmp (here I realize I forgot to name the branch so I typed again:
git branch tmp (long has I copied)
i got a warning here about how the rename (long hash) is ambiguous, and Git normally never creates a ref that ends with 40 hex characters
git merge tmp
here git said "already up to date"
git branch -d tmp
output: deleted branch tmp
after doing this, I was taken back to the state in which I was last attached to the head (wayyy back in my project).
Am I screwed? Or is there any way I can recover where I was at?