The screwed up and committed to master should end with:
git reset --hard origin/master
(assuming that the remote is called "origin") With the example in the text, you have to know the number of commits you've made to master.