Home > Features, General > Subversion: How to revert to a previous revision

Subversion: How to revert to a previous revision

March 27th, 2007

You’ve been there. You have been developing in your trunk for a while and at revision 127 you get the feeling you’ve done it all wrong! The production server is humming away at revision 123 and that’s where you want to start out again. But how can you start again from revision 123? Easy as this with Subversion

$ svn merge -rHEAD:123 .

This will see what changes you’ve made since r123 up until now (r127 in your case) and ‘undo’ them. Next you check in the code and you’ve go a sweet r128 that is exactly the same as r123. You can start over now!

Please share the love of this post by bookmarking it, and sharing it with others. Thanks!

  • Digg
  • del.icio.us
  • description
  • Reddit
  • Facebook
  • E-mail this story to a friend!
  • TwitThis

  1. December 5th, 2007 at 09:58 | #1

    Thank you so much for telling this! I really appreciate it, because I have looked everywhere on the internet and couln’t find it immediately, thanks!

  2. MJ
    February 9th, 2008 at 11:15 | #2

    You just saved my ass

  3. Joseph
    April 25th, 2008 at 15:05 | #3

    saved me hours of work =) thanks for the tip bro

  4. June 20th, 2008 at 17:25 | #4

    FYI I’ve implemented a GUI method to do this operation in MonoDevelop:

    https://bugzilla.novell.com/show_bug.cgi?id=394434

    Regards.

  5. kaotisch
    July 2nd, 2008 at 18:38 | #5

    Worked perfectly, thanks :)

  6. Cmyker
    August 13th, 2008 at 10:59 | #6

    Many thanks, very helpful post

  7. September 3rd, 2008 at 13:48 | #7

    Tortoise svn does this well

  8. steve
    November 13th, 2008 at 06:23 | #8

    Excellent.

  1. No trackbacks yet.