Version Control
git checkout
Switch branch or restore files.
Syntax
$git checkout [OPTIONS] <BRANCH|FILE>
Examples
$git checkout main
$git checkout -b newbranch
$git checkout -- file.txt
Typical use cases
?
Standard usage
git checkout --help
Note
Switch context.
Export