title: How can I remove files that were changed and then reverted on a branch from a merge
body: <p>I have a branch in Perforce on which I have checked in changes to several thousand files, and then later backed out the changes to approximately half of those files - so the latest revision of some of the files on the branch is unchanged from the baseline, but there are intermediate revisions with changes.</p>
  
  <p>In many cases there have also been out-merges from mainline in the meantime, so the history is a bit more complicated, but the eventual result is that there are no content changes left to merge back to mainline.</p>
  
  <p>I now want to merge that branch to mainline, but I don't want to check in "null" changes to the files that in the end were not modified on the branch.</p>
  
  <p>Normally one can avoid checking in unchanged files with "Revert unchanged files" in p4v, but in this case it won't revert the files, because it believes that the file needs to be checked in to update the integration record. The help for <code>p4 revert</code> confirms this:</p>
  
  <blockquote>
    <p>The -a flag  reverts only files that are open for edit or integrate
    and are unchanged or missing. <strong>Files with pending integration records
    are left open.</strong> The file arguments are optional when -a is specified.</p>
  </blockquote>
  
  <p>Is there any way I can avoid checking these files in without going through them one by one? I'm happy to do whatever is necessary on the branch, and I'm not too worried about it it causes future merges <em>to</em> the branch as I will be abandoning it soon after this merge.</p>