How do I restore files to previous states in git?

Viewed 76878

Given the following interaction:

$ git add foo 
$ git commit -m "Initial import of 'foo'"
$ rm foo # This could be any destructive action on foo, like editing it.

How do I restore 'foo' in my working copy? I'm looking for something like:

$ git <magic> foo
Restored foo to revision <blah>.
0 Answers
Related