[Git] Bring a file over from another branch

Created on November 30, 2026

Use git checkout with a branch followed by -- and a path. This example copies README.md from the some-fix branch into the working tree and stages it, while staying on the current branch.

git checkout some-fix -- README.md

Use git status to see the staged change.

On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   README.md

Git