no merge without common ancestors
happened).  If this is not the case, use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>git filter-branch --parent-filter \
        'test $GIT_COMMIT = &lt;commit-id&gt; &amp;&amp; echo "-p &lt;graft-id&gt;" || cat' HEAD</pre>
</div>
</div>
<div class="paragraph">
<p>or even simpler:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>git replace --graft $commit-id $graft-id
git filter-branch $graft-id..HEAD</pre>
</div>
</div>
<div class="pa