git restore
DestructiveRestore files
git restore <file>
Discards working changes, or unstages with --staged.
Examples
git restore --staged app.swiftUnstage a file
Syntax
git restore [--staged] <file>
Before you run it
Discarding loses uncommitted changes.
Related commands
- git resetReset state
- git statusWorking tree status
Check it once more before you run it
Some commands cannot be undone if one flag is wrong. An on-device reference works with no connection. Free to install, no ads.
Get it free on the App Store