git diff HEAD~1 -- src/app.js

Category: Git - Core

git diff HEAD~1 -- src/app.js

Show the latest changes to a single file

Diffs the named path between the previous commit and the working tree, filtering the patch to just that file. The HEAD~1 syntax means the commit one step before HEAD. Use HEAD~3 or a branch name to look further back.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.