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