title: Git checkout HEAD+1 and HEAD-1
body: <p>In this situation: </p>
  
  <pre><code>              v HEAD
       o--o--o--x--o--o (foo)
      /
  o--o--o--o--o--o--o (master)
  </code></pre>
  
  <p>If I want to move one step backward I type:</p>
  
  <pre><code>$ git checkout HEAD~1
             v HEAD   
       o--o--o--x--o--o (foo)
      /
  o--o--o--o--o--o--o (master)
  </code></pre>
  
  <p>If I want to move a step forward I came with this ridiculous command:</p>
  
  <pre><code>$ git log --pretty=oneline --all | \
         grep -B1 `git rev-parse HEAD` | \
         head -n1 | egrep -o '[a-f0-9]{20,}' | xargs git checkout
  
                   v HEAD
       o--o--o--x--o--o (foo)
      /                 
  o--o--o--o--o--o--o (master)
  </code></pre>
  
  <p>Can I do better such as <code>git checkout HEAD+1</code>?</p>
  
  <p>My current implementation in my <code>~/.gitconfig</code> is:</p>
  
  <pre><code>[alias]
      # Move forward/Backward
      fw = "!git log --pretty=oneline --all | grep -B1 `git rev-parse HEAD` | head -n1 | egrep -o '[a-f0-9]{20,}' | xargs git checkout"
      bw = "!git checkout HEAD~1"
  </code></pre>