1

Let's say I have a project which is currently on revision 100. I now realize that the last few days of changes are completely wrong, and I want roll back all changes to revision 95 and begin development again from there. Ideally, I would execute command(s) to roll back to 95, then recommit the changes so my repository would be at revision 101 with all files in the project being equivalent to version 95.

The first few times I tried this (I don't remember exactly what I did) all it managed to do was set all my changed files into a conflicted state (and gave me weird errors when I tried to resolve them). I finally managed to get my working copy rolled back to 95 (via something like this), but when I tried to do a commit, it told me I could not do it until I updated the project. Well, updating the project bumped all the files back to the 100 version, except the 1 or 2 I had changed since rolling back (they went back into conflicted).

How can I tell SVN to put my working copy at version 95, ignore all changes in versions 96-100, and commit the ver 95 working copy as the new head revision for all files?


Additional info: We are running a self-hosted version of SubversionEdge, and interfacing with it via TortoiseSVN and AnkhSVN. I am the only person working on said project, and there is almost no chance of any changes being made by someone else (even if there were, I'd still want 95 to overwrite everything).

2 Answers 2

2

Since you said you are using TortoiseSVN, just use "Revert to this revision" and then commit that. This reverse merges all changes from HEAD to that revision, and allows you to commit it.

enter image description here

The answer you linked to uses "Revert changes from this revision", which is just a reverse merge of that one revision. You should have been able to commit that change however, so I suspect you may have used "Update item to revision", which you cannot commit the changes on until you update to HEAD.

1
  • This caused several files to go back into conflicted (as it had when I tried to solve this on my own), but once I fixed all of them manually, the process worked as I desired. I'm not sure if I didn't do it this way the first time, or if it's because I tried to do something with Ankh before Tortoise that caused the conflicts but it seems to have worked now. Thanks!
    – techturtle
    Oct 15, 2014 at 21:12
1

You can do this simply in 2 steps:

svn merge -r:100:95 repo_path

svn commit -m "Reverted to revision 95."

2
  • I have not used many command line options with svn, but merge sounds like it would keep elements of both 95 and 100. Will this literally merge them, or will it actually set 95 as the head?
    – techturtle
    Oct 14, 2014 at 18:33
  • merge will actually set 95 as the head and using tortoise svn you can also perform same operation by "Merge to revision" Oct 15, 2014 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.