title: git-checkout older revision of a file under a new name
body: <p>I have the file "<code>main.cpp</code>" open in my editor.</p>
  
  <p>I want to see the previous revision of "<code>main.cpp</code>" in the editor too.</p>
  
  <p>The way I do it now is like this.</p>
  
  <pre><code>close "main.cpp" in the editor
  
  prompt&gt; mv main.cpp tmp
  prompt&gt; git checkout HEAD^ main.cpp
  prompt&gt; mv main.cpp old_main.cpp
  prompt&gt; mv tmp main.cpp
  prompt&gt;
  
  open "main.cpp" and "old_main.cpp" in the editor
  </code></pre>
  
  <p>Can it be simplified, so I don't have to close "main.cpp" in the editor? </p>
  
  <p>What I'm hoping for is a variant of <code>git-checkout</code> that can do this.</p>
  
  <hr>
  
  <p>UPDATE: im using git on mac osx 10.5.7</p>
  
  <pre><code>prompt&gt; git --version
  git version 1.6.0.4
  prompt&gt; 
  </code></pre>
  
  <hr>
  
  <p>UPDATE2: Jakub Narębski answer is:</p>
  
  <pre><code>prompt&gt; git show HEAD^:dir1/dir2/dir3/main.cpp &gt; old_main.cpp
  prompt&gt;
  </code></pre>
  
  <hr>
  
  <p>UPDATE3: Karmi's answer, for a specific revision:</p>
  
  <pre><code>prompt&gt; git show 4c274dd91dc:higgs/Higgs.xcodeproj/project.pbxproj &gt; old_project.pbxproj
  prompt&gt; 
  </code></pre>