tags:

views:

46

answers:

3

Suppose I'm at revision 50. But, I want to revert back to revision 45, and commit back as the stable version.

How do I do that, in the most simple way?

  1. What if I want to do that with one file?
  2. What if I want to do that with the entire repository?
+2  A: 

Reverse merge those revisions that you want to undo. This can be done on one or multiple files. By reverse merging, your working copy gets changed to the state without that revision, which you then can commit.

Sjoerd
A: 

I think one simple way should be this:

  • checkout revision 45 to a temporary directory
  • copy one or alle files to your working directory
  • commit
splash
See "Why Not Use Patches Instead?" in the [SVN book](http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchemerge.basicmerging.stayinsync) why you should avoid manual merging.
sbi
Thanks for the hint!
splash
A: 

I'm not sure what you mean by "commit back as the stable version", but depending on what you're trying to accomplish I recommend:

svn update -r45
This will rebase your working copy at revision 45.

or:

svn merge -c -50,-49,-48,-47,-46
This will update (by reverse-merging) your working copy by removing all the changes between 45 and 50. Now if you make changes and commit, it will be like you have removed 46-50 from the repository and made the HEAD revision (51?) to be r45 + your change.

William Leara