git restore
WorkflowRestore working tree files
Options & Flags
Available options for this command
--stagedUnstage files
Examples
Common usage examples
Discard changes in file
git restore file.txtUnstage file
git restore --staged file.txtNotes
- Introduced in Git 2.23 as clearer alternative to checkout
Related Commands
You might also find these useful