I recently did a hard head reset, stupidly thinking I was resetting my Android Studio project to the earliest commit I made. I learned here I can undo the hard reset
What you want to do is to specify the sha1 of the commit you want to restore to. You can get the sha1 by examining the reflog (git reflog) and then doing
git reset --hard
But don't wait too long... after a few weeks git will eventually see that commit as unreferenced and delete all the blobs.
But I'm unable to use git reflog. I get thisn message when I run that command
bad default revision 'HEAD'