Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

Given a file foo.m, how can I get Git to show me the complete contents of foo.m, as they were at some commit x?

like image 674
Bill Avatar asked Feb 19 '10 04:02

Bill


1 Answers

git checkout sha1_here  -- foo.m

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

git show sha1_here:path_to_file/foo.m
like image 112
Philip Fourie Avatar answered Oct 31 '22 17:10

Philip Fourie