git - how to abandon changes and get back in sync with master

try to do a commit, and get a message like:

Your branch is ahead of 'origin/master' by 1 commit.

to abandon your changes and get back in sync do:

git reset --hard origin/master