Skip to main content

Subversion: How to revert to a previous revision

·105 words·1 min· ·
General Features Subversion
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

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!

Related

4 Unusual uses for Subversion
·267 words·2 mins
General Features Subversion
Subversion Cheat Sheet 1.0!
·124 words·1 min
General Features Subversion
SVN: How often should you commit?
·448 words·3 mins
General Everything Features Subversion