Want to delete revisions from the SVN repository

svntortoise-svnversion control

The latest revisions in my code repo has been corrupted and has destabilized my app. I want to revert to an earlier revision.

But I don't want to simply use 'revert' on my working copy; I actually want to delete my head revision and several revisions prior in my repo, thereby 'reverting' my repo to an earlier revision, which would become the head revision. Anyone know how I would do this?

Best Answer

Maybe this link helps you:

http://www.sampablokuper.com/2009/03/27/svn-revert-to-revision/

Quote:

  1. Change to the top directory within your working copy (assuming you want to roll back the whole of the working copy).

  2. run svn revert to revert your working copy's files to the state they were in when you last committed/checked out.

  3. run svn status -v to see which revision number your working copy now corresponds to (it's the highest revision number in the list that svn status -v produces).

  4. run svn merge -rXX:YY where XX is the number you obtained in the previous step and YY is the number of the revision you want to revert to.

  5. Done! The possible exception to this is that files in your working copy that didn't exist when revision YY was originally made, will still be there, because by default svn doesn't remove things. If you want to get rid of them, run a svn del [filename] on each of them.

  6. Well done! Now play with your working copy as though all those intermediate edits had never happened . And when you're ready to commit your efforts, just use svn commit as usual!

Related Question