How can I discard all unstaged changes in my Git repository?
We can do this using git restore
. To discard changes for all files in our current working directory run the following:
git restore .
To discard unstaged changes for a specific file, run the following:
git restore path/to/file