Commands.app

git restore

Workflow

Restore working tree files

Options & Flags
Available options for this command
--staged

Unstage files

Examples
Common usage examples

Discard changes in file

git restore file.txt

Unstage file

git restore --staged file.txt
Notes
  • Introduced in Git 2.23 as clearer alternative to checkout
Related Commands
You might also find these useful