title: Difference between git reset --hard and git checkout
body: <p>Let's say I want to undo all changes introduced by previous commits.</p>
  
  <p>As far as I understand, <code>git reset --hard &lt;specified commit&gt;</code> will remove all commits up until the specified commit, and undo all changes.<br>
  On the other hand <code>git checkout &lt;specified commit&gt;</code> will change my directory to reflect the specified commit.</p>
  
  <p>So if I <code>git reset</code> after <code>git checkout</code> will it have the same result as <code>git reset --hard</code>?</p>
  
  <p>Alternatively, if I simply <code>git commit</code> after <code>git checkout</code>, will the newly created commit overwrite the existing commits?</p>