git checkout -p src/app.js

Category: Git - Core

git checkout -p src/app.js

Apply selected hunks from a file

Walks through the file's diff hunk by hunk, asking whether to apply each one to the working tree. It is the reverse of git add -p: selecting what to discard or check out. Answer y, n, or s to split a hunk and control the result.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.