Setup a Git Alias for Rolling Back Any Pending Changes
I have a hard time remembering git reset —hard HEAD for some reason when I want to rollback changes to the last commit in my working branch when I go down a path that doesn’t work. Mercurial has an easy to remember command for this hg rollback. Git has a feature called Alias though that you can use to create your own commands. I setup a rollback Alias to mimic the Mercurial command by entering the following into a command prompt:
git config —global alias.rollback “reset —hard HEAD”