Got to this question also looking to revert to match origin (ie, NO commits ahead of origin). Researching further, found there's a reset
command for exactly that:
git reset --hard @{u}
Note: @{u}
is shorthand for origin/master
. (And, of course, you need that remote repository for this to work.)