title: How to save current changes in repo, go back to an old commit, go back to most recent commit, and restore changes?
body: <h3>Scenario</h3>
  <p>Long story short, I need to go back to an old commit to run some code, but I eventually want to come back to the most recent commit. However, I've made some changes that I'm not ready to commit.</p>
  <p>For this reason, I want to stash my current changes, then go back to the old commit, do what I need to do, then come back to the most recent commit, and restore the changes I originally made.</p>
  <p>Note: This is all on one branch</p>
  <h3>Question</h3>
  <p>What's the best way to go about doing this?</p>
  <h3>My ideas</h3>
  <p>I was think of doing something like:</p>
  <pre><code>git stash push
  git checkout &lt;old_commit_hash&gt;
  #Do some stuff
  git checkout &lt;most_recent_commit&gt;
  git stash pop
  </code></pre>
  <p>Another idea is to commit my current changes. Eventually when I return to this commit, I could create another commit to finalize my work, and then use <code>git rebase</code> to squash them into one new commit.</p>