There is one additional step to Amber's answer if you're using a centralized repository:
git push -f
to force the update of the central repository.
Be careful that there are not a lot of people working on the same branch because it can ruin consistency.