You can also pull the latest commit and just undo until the commit you desire:
git pull origin master
git reset --hard HEAD~1
Replace master
with your desired branch.
Use git log to see to which commit you would like to revert:
git log
Personally, this has worked for me better.
Basically, what this does is pulls the latest commit, and you manually revert commits one by one. Use git log in order to see commit history.
Good points: Works as advertised. You don't have to use commit hash or pull unneeded branches.
Bad points: You need to revert commits on by one.
WARNING: Commit/stash all your local changes, because with --hard
you are going to lose them. Use at your own risk!