Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Undo commit in subversion. svn merge -r 1708:1707—I can never remember how to do this.

Tagged , , ,

4 comments

  1. Subversion 1.4 also includes a -c switch that lets you target a single revision. This comes in very handy to revert one: the command you wrote can also be written svn merge -c -1708 (-c rev translates into -r rev-1:rev while -c -rev translates into -r rev:rev-1), which can easily enough be read as "merge the reverse of revision 1708".

    masklinn - 3rd January 2008 18:23 - #

  2. You can also use revision keywords, that way you don't have to futz around with rev numbers. I use this to roll back my borked commits: svn merge -r COMMITTED:PREV /local/path/to/file

    Paul Smith - 3rd January 2008 20:39 - #

  3. -c is gold! Serves me right for reading an old subversion book and not bothering to check if I could reverse merge!

    Justin French - 4th January 2008 00:18 - #

  4. If you are using TSVN, select revision(s) in log view, right click & select "Revert changes from this revision".

    Suraj Barkale - 4th January 2008 14:45 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site