Question: I accidentally committed a change in `branches/2.1/foo.cpp` instead of `branches/2.0/foo.cpp`.

The most straightforward way to fix this seems to be to merge the change back to 2.0:

```
~/branches/2.0 $ svn merge svn://repository/branches/2.1/foo.cpp foo.cpp

```

But, according to [this document](http://svnbook.red-bean.com/en/1.8/svn.branchmerge.advanced.html) this should be avoided:

> 
> Avoid subtree merges and subtree mergeinfo. Perform merges only on the root of your branches, not on subdirectories or files 
> 
> 
> 

What would be the best way to go about then?

Answer: 
Undo the erroneous commit as per [Retract accidental checkin](https://stackoverflow.com/questions/747713/subversion-retract-accidental-checkin/747758#747758) .

Then do whatever you wanted originally.
You should do a merge of the specific revision in this case. Assuming there is not other stuff mixed into the revision that you don't want to merge, you might have a command something like this:

> 
> ~/branches/2.0 $ svn merge -r4567 svn://repository/branches/2.1 .
> 
> 
>