Quickly discard a file's changes in the working directory and index, restoring it to HEAD.
- Open any file that has been modified in editor;
- Press
Cmd+R Cmd+R
to rollback file.
Rollback changes on file:
- For untracked file, use
git clean -fx <file>
- For tracked file, use
git restore -WS <file>
- git >= 2.23