GitBranching

git checkout

Switches branches or restores working-tree files.

Syntax

git checkout <branch> | git checkout -b <new-branch>

Examples

Create and switch to a new branch in one step

git checkout -b fix/memory-leak

Related commands