I have the master branch of my repository checked out. It has the following 4 files.
- One.txt
- Two.txt
- Three.txt
- Four.txt
While reading each of these files, I ended up making small but unintentional changes to Two.txt and Four.txt. These changes are of the nature of adding line breaks or spaces or removing some of them. It wouldn't hurt to check them in but I'd rather not.
I am still in the master branch and I'd like to undo the changes I made to these two files.
When I do:
$ git status
It reads:
Changes not staged for commit.
Two.txt
Four.txt
I understand that unless I git add them, the changes to these files will be un-tracked and hence will not be considered for commits.
But I'd still like to rollback changes I made to these files and get the real version that I downloaded.
I did:
$ git checkout
But that didn't make the red go away.
Then I did:
$ git pull
So it would fetch and merge from the remote master into my local master but that didn't overwrite the changes I made to Two.txt and Four.txt.
How do I overwrite the changes I made to Two.txt and Four.txt with the original content that the remote repo's master had?