What git needs is a simple undo command, as in
git undo
and it just undoes whatever you just did. There seems to be a way to undo pretty much anything, but I usually end up googling and deciphering the likes of git reset HEAD hard -f --now origin/master --no-rebase %${%&`+'${`%&NO CARRIER")
Then when that goes wrong, you're in real trouble and left scratching your head at git's error message.