I was working on master, finished up what I needed to do, then did
git commit -am "message".
I wanted to test out writing a new feature, so I did:
git branch NewFeature
followed by
git checkout NewFeature
I then made changes to version controlled files, came back to git and did
git checkout master
What I forgot to do was commit those changes to the NewFeature branch. My fault, yes, but looking around on SO it seems like that should have failed without the -f flag. Unfortunately, it just merged my changes with master. Naturally I freaked out and did
git reset --hard head
It seems like I lost all the work I had done on the NewFeature branch when I switched back as well! What did I do wrong?