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