I had locally staged and committed some files and tried to push them online but it wasn't working because one folder was too large. I wanted to undo the commit of that folder and I ended up doing a reset which was a bad idea. It caused my working folder data files to disappear. I was having a mini heart attack. Then I gathered my senses and searched for a solution online to restore data to the earliest commit. The command git reflog saved my life as it displayed the commit ID of the very first commit I needed to revert to and resetting to that commit gave me back my data. Alhamdulillah.
Following is a snippet from the StackOverflow answer (https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) which helped:
Following is a snippet from the StackOverflow answer (https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) which helped:
$ git reflog
1a75c1d... HEAD@{0}: reset --hard HEAD^: updating HEAD
f6e5064... HEAD@{1}: commit: added file2
$ git reset --hard f6e5064
HEAD is now at f6e5064... added file2