git show

The command that displays one object in full, usually a commit with its message and patch, or a file as it was in a given commit.

In more detail

git show HEAD~2 prints that commit and its changes; --stat summarises instead, and -s hides the patch. git show HEAD~2:parser.py prints the file exactly as it was in that commit without changing your working tree. On a tag it shows the tag details and then the commit.

Examples

git show HEAD~1:service.env
git show -s --oneline HEAD~2

Related terms

Taught in

References