git show HEAD~1:src/app.js

Category: Git - Core

git show HEAD~1:src/app.js

Show a file as of an older commit

Prints the content of the named path at the given revision without touching your working tree. The revision:path syntax works for any commit, tag, or branch. Use it to inspect an old version before deciding to check it out.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.