Making two branches identical
<p>I have two branches - A and B. B was created from A.</p>

<p>Work on both branches continued in parallel. Work on branch A was bad (resulting in a non-working version) while work on branch B was good. During this time branch B was sometimes merged into branch A (but not the other way around).</p>

<p>Now I want to make branch A identical to branch B. I can't use git revert because I need to revert too many commits - I only want to revert the commits that were done on branch A but not as a result of merging branch B.</p>

<p>The solution I found was to clone branch B into a another folder, delete all the files from the working folder of branch A, copy the files from the temp branch B folder and add all untracked files.</p>

<p>Is there a git command that does the same thing? Some git revert switch I missed?</p>