I had the following scenario:
I have my local branch and committed changes to the local branch. Say my local branch is tracking the master branch from repository.
local ---> origin/master
Consider the file as a/b/c.d I have modified contents of this my file in my local branch.
Now I wished to check out how things would behave with the original c.d with my other code changes.
So I did :
git checkout origin/master a/b/c.d
Now I wish to go back to the original file in my local branch commit.
I did:
git reset a/b/c.d
git checkout -- a/b/c.d
I got back my original file (present in my local branch).
Is it the right way of doing things or there is a better way to discard the changes and get the file in my local branch after:
git checkout origin/master a/b/c.d
Could not find a scenario after googling.
Thanks