2009-04-12

Rollback a change with a reverse merge (II)

An common use for svn merge is to roll back a change that has already been committed. In August 2006, I wrote an article explaining how to manually rollback a change with a reverse merge. The solution described by that time was based on a inverted range of revision:
svn merge -r 481:480

With the release of Subversion 1.4.0 in September 2006 (no luck), a new -c paramater is added to the svn merge command:
-c [--change] ARG :the change made by revision ARG (like -r ARG-1:ARG).
If ARG is negative this is like -r ARG:ARG-1

Using -c -ARG is equivalent to using -r ARG:ARG-1 but is more user friendly:
svn merge -c -481
Do not forget to commit the modifications to your local copy after the merge:
svn commit .
source: basic merging, subversion changelog