๐Ÿ” History

How to inspect a specific commit in Git

View the full details and changes of a specific commit.

Show the last commit
git show

Shows the full diff and metadata of the most recent commit.

Show a specific commit
git show abc1234

Shows the full diff and metadata of a specific commit hash.

Show a file at a specific commit
git show abc1234:path/to/file.txt

Displays the contents of a file as it was at a specific commit.

When to use: Recovering content from a file at a past point in time.

Show commit stats only
git show --stat abc1234

Shows which files changed and how many lines were added/removed.

โ† Back to Git Reference