Compare

git restore vs checkout

When to use the newer restore command and when checkout still makes sense.

`git checkout` historically handled both branch switching and file restoration. `git restore` narrows the file-restoration use case, which makes destructive actions easier to reason about.

Use Restore When

You want to discard or recover file changes without touching branches.

You want clearer intent in modern Git workflows.

Use Checkout When

You are switching branches or using an older workflow that still relies on checkout for multiple jobs.

You are working in an environment where the team still uses checkout heavily and consistency matters.

Rule of Thumb

Use restore for files. Use checkout for branches.

Want the short version? Browse the compact sheet views and save the commands you use most into a Cheatbook.