Undo local changes to a file in git

You've changed the file locally, and you now regret it.

Get the version git has by using 'checkout' like this:

git checkout -- filename.txt

Source

See also