title: What if I realize I should have committed an edit five commits ago?
body: <p>This is a common problem for me. I make five or so commits then find that some debug code that became irrelevant or junk code from a prior used algorithm stays around. Amending them to HEAD doesn't always make sense and making a new commit for a one-line late change feels disorderly. </p>
  
  <p>The solutions I know of include the above and checking out the previous commit, branching, editing and merging again. This works fine, but I wonder if either a more idiomatic or elegant solution exists.</p>