Realised you can use git-reset in a funky way if you're trying to repair a repo that's got into a dodgy state. If you're working locally, you can use git reset --hard
or git rebase -i
or whatever to rewrite your history (if you're into that sort of thing) but when the commits have already been pushed things are slightly more complicated.
git reset --hard last_good_commit
git reset --soft ORIG_HEAD
git commit -m 'threw away changes back to last_good_commit'
git push