Use Restore When
You want to discard or recover file changes without touching branches.
You want clearer intent in modern Git workflows.
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.
You want to discard or recover file changes without touching branches.
You want clearer intent in modern Git workflows.
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.
Use restore for files. Use checkout for branches.