svn merge -c

How many times have you frantically googled “svn merge revert” to remember how to undo a recent commit? If you answered “too many” then you were probably confused by the syntax of svn merge -rARG1:ARG2. After this post you’ll never have that problem again because you can easily memorize svn merge -c-ARG instead.

# to undo changeset 1234 in the working copy:
svn merge -c-1234 files

The c is for “change” and the - means “in reverse”. When you read that command to yourself, say “svn merge change in reverse 1234″. That is sensible enough that you can remember it forever, even in an emergency. Right?

To apply several changes at once, use several -c- options:

# to undo two changesets at once:
svn merge -c-1234 -c-1220 files

To re-apply the changes in your working copy for debugging, use -c:

# to re-apply the changes you undid:
svn merge -c1220 -c1234 files

May this knowledge shave precious seconds off your next svn emergency!

Follow

Get every new post delivered to your Inbox.

Join 1,664 other followers