How can I see the file as it was with a particular git commit?

Given the file foo.m, how can I get Git to show me the full contents of foo.m, as it was in some x fix?

+5
source share
1 answer
git checkout sha1_here  -- foo.m

or without checking the file and just viewing it from the command line

git show sha1_here:path_to_file/foo.m
+8
source

All Articles