Compare file between commits when folder structure has changed
<p><strong>Question:</strong><br/>
How do I <code>git diff</code> a particular file when the folder structure has changed between <code>commit_hash_1</code> and <code>commit_hash_2</code>?</p>

<p><strong>What I know:</strong><br/>
I can <code>git diff</code> a file between two commits with:</p>

<pre><code>git diff commit_hash_1 commit_hash_2 folder/file.ext
</code></pre>

<p><strong>Attempted Solutions:</strong><br/>
<strong>1.</strong> My guess was something like:</p>

<pre><code>git diff commit_hash_1:/folder/file.ext commit_hash_2:/new_folder/file.ext
</code></pre>

<p>But that doesn't work; it gives me:</p>

<pre><code>fatal: Path '/new_folder/file.ext' does not exist in 'commit_hash_2'
</code></pre>

<p><strong>2.</strong> So the other option is:</p>

<pre><code>git diff commit_hash_1 commit_hash_2 new_folder/file.ext
</code></pre>

<p>But that starts a comparison between the <code>commit_hash_2</code> <code>file.ext</code> and <code>/dev/null</code>.</p>