Restore (modified)
Restore (modified)
What if you realize that you don’t want to keep your changes to the file? How can you easily unmodify it — revert it back to what it looked like when you last committed (or initially cloned, or however you got it into your working directory)
The below steps shows how a file was modified and then unmodified using the git restore command:
Note: instead of unmodifying all files, we can select a specific file by giving its name in the above restore command in place of .
A reload might be required in the text editor to reflect the changes which Git is doing, but tools like VS Code and IDEs usually refresh it automatically!
Last updated