Reputation: 13548
I've made a couple of changes on my local files but I have not commit or added any of them. I want to go back to my previous commit before this recent changes. How can I do this?
Upvotes: 1
Views: 137
Reputation: 129526
git reset --hard
will remove those changes.
However, just in case, I would add them
git add -A
and then stash them
git stash
Just in case you regret your decision. The last 2 commands can be shortened to:
git stash -u
Upvotes: 2
Reputation: 2393
git checkout might do the job for you. You should be able to do something like:
git checkout FILE_TO_REVERT
Upvotes: 1