如何在特定的git提交中查看文件?

Bil*_*ill 5 git

给定一个文件foo.m,我如何让Git向我展示foo.m的完整内容,因为它们处于某个提交x?

Phi*_*rie 8

git checkout sha1_here  -- foo.m
Run Code Online (Sandbox Code Playgroud)

或者不检查文件,只是从命令行查看它

git show sha1_here:path_to_file/foo.m
Run Code Online (Sandbox Code Playgroud)