title: How can I remove all local commits and go to the last commit on the branch master (on remote repository)?
body: <p>I have made some changes in the repository and registered a commit (on local). And then I executed this:</p>
  
  <pre><code>$ git pull origin master
  </code></pre>
  
  <p>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). </p>
  
  <p>I can change the working directory by this command:</p>
  
  <pre><code>// the last commit on the remove branch master
  $ git checkout 84acc42 .
  </code></pre>
  
  <p>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. </p>
  
  <p>Noted that <code>$ git reset --hard</code> doesn't remove anything. I executed that and still see the changes I don't want.</p>
  
  <p>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.</p>