After running git reset HEAD~1, I noticed that actually there was nothing else to do and the commit was fine. Is there a way to revert this command?
git reset HEAD~1
Even easier (if you haven't done any other operations):
git reset ORIG_HEAD
ORIG_HEAD is the previous state of HEAD.
ORIG_HEAD
HEAD
More details about HEAD vs. ORIG_HEAD are in the answer to this SO question.