How to *Actually* Revert in Subversion

Some Subversion naming conventions are downright lousy. For instance, “svn revert” reverts your code to some older revision, right? Well that’s what you think, my sensible friend, and you’re wrong! All it does is it reverts your working file to the latest version in the repository, the same thing that can be accomplished with a simple delete and svn update.

So to actually revert to an older version in the repository, you have to issue this madness:

svn merge -rhead:123 http://my/svn/repository ./workingcopy

Where 123 is the number of the old revision to which you want to revert.

This entry was posted in Technology. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. gth
    Posted September 4, 2007 at 1:49 pm | Permalink

    Right!!

  2. Reddy
    Posted February 12, 2009 at 9:53 am | Permalink

    Thanks. It worked.

  3. Posted September 15, 2009 at 3:46 am | Permalink

    Nice tip! Thanks.

  4. laDanz
    Posted October 15, 2009 at 6:16 am | Permalink

    Thanks. It worked.

  5. raoul schmidiger
    Posted November 12, 2009 at 6:01 am | Permalink

    It’s a pain. These SVN people are responsible for so much wasted time. Sure it amounts to billions globally. Version control systems should *just work*. Time to consider alternatives…

  6. Tim
    Posted February 11, 2010 at 8:05 am | Permalink

    Hmm, maybe its easier (although admittedly not straightforward) to just use
    svn update –revision N
    where N is the revision number you want to go back to. At least you don’t have to look up the web address.
    I agree, though, that revert should be able to take a revision number and then just do that…

One Trackback

  1. By Subversion on OS X on February 18, 2010 at 6:22 am

    [...] copy of the your project, or even to an earlier copy of a file in your project. Aran has a post, as does robozen telling you you to do this. It is really useful if the log files are up to date – see above. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>