git: Equivalent of Subversion's 'revert'

I’m totally sold on git, but having used Subversion for… oh man… 7 or 8 years more, sometimes I have difficulty remembering how to do something the git way instead of the SVN way. Reverting a file is one of those things.

To revert changes made to a file that you’ve not yet committed, it’s as simple as…

git checkout -- filename