If you want to keep your mistake in the history, this will add commits which compensate the commits you specify. (master must be checked out locally) For example, if you want to revert the last commit, you can use:
git revert master
git push origin master
If you want to remove the last 2 commits from history (master must be checked out locally):
git reset master~2
git push -f origin master
Or without changing anything local, this should work as well:
git push -f origin master~2:master
The last two will force-update the master to the third from last master
commit. Which is problematic if someone else already pulled the commits you are removing.