Last Updated: February 25, 2016
·
503
· dsci

Git: Checkout a single file from a different branch

Okay - let's face it. The following lines are more a personal memo to me than a real protip. But maybe somebody is out there how can't remember that too - or didn't know about.

Sometimes you want to have a single file in your current branch that resists in one of your another local branches.

No worries, Git has all you need for that:

git checkout feature_branch -- path/to/your/wanted/file

where feature_branch</code> is the name of your branch.

(That was a short one of a protip for this time. ;-) )