Updated: 21 September 2025
Create local branch with same name as remote one, directly establishing a tracking relationship
git checkout --track remote_name/branch_wanted_locally
Checkout a single file from a specific commit
git checkout commit-hash path/to/the/file
Checkout file(s), as it was at a particular commit
git checkout commit-hash -- my/file another/file2
Checkout directory from another branch
git checkout another-branch -- the-dir/
Checkout one file from another branch
git checkout grab-from-this-branch -- logout.js