Git · Branches and integration
git checkout
The older multi-purpose command for branches and files. Use switch and restore in new workflows.
Syntax
git checkout <branch>Example
Example
git checkout main git checkout -- src/app.ts
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.