Git: Peek: Show your file without your changes
Created on November 12, 2025
git
git show HEAD:./path/to/file
git show HEAD:./path/to/file | less
git show HEAD:./path/to/file | vim -
Bonus: Compare currently commited version with the previous commit:
git diff HEAD~1 HEAD -- path/to/file
Mental Model:
- HEAD = current commit
- HEAD~1 = one commit before
- HEAD~2 = two before
- git diff A B = “changes needed to turn A into B”