Due to some bad cherry-picking, my local git repository is currently 5 commits ahead of the origin, and not in a good state. I want to get rid of all these commits and start over again.
Obviously, deleting my working directory and re-cloning would do it, but downloading everything from github again seems like overkill, and not a good use of my time.
If your excess commits are only visible to you, you can just do
git reset --hard origin/<branch_name> to move back to where the origin is.
git revert makes new commits to remove old commits in a way that keeps everyone's history sane.