I have made some changes in the repository and registered a commit (on local). And then I executed this:
$ git pull origin master
And my local commit merged with the pulled one. Now I regret. I want to get the last version which is on the remote branch master and get ride of the local commit (which is merged).
I can change the working directory by this command:
// the last commit on the remove branch master
$ git checkout 84acc42 .
But if I make some changes on it and push it, I guess that previous changes still are exists and will be pushed as a commit too. Because that commit is exists.
Noted that $ git reset --hard
doesn't remove anything. I executed that and still see the changes I don't want.
Any idea how can I get the last version which is on the remote repository (branch master) and remove everything else? I can do that by removing the local working directory and cloning it again from the repository. But I want to know if there is another way.