today-i-learnt

Copy file from another git branch

Category git
Added on 2026-03-17
Source source

After git 2.23:

$ git restore --source otherbranch path/to/myfile.txt

Works on folders too!

Alternatives: