git checkout

An older all-purpose command that switches branches and also restores files; newer Git splits these jobs into git switch and git restore.

In more detail

git checkout -b feature/42-new-button creates a branch and switches to it, like git switch -c. During a merge conflict, git checkout --ours or --theirs takes one side of a file entirely. It still works everywhere, so you will meet it in older instructions.

Example

git checkout -b feature/42-new-button

Related terms

Taught in

References