Home » Questions » Computers [ Ask a new question ]

Want to delete revisions from my SVN repository

Want to delete revisions from my SVN repository

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

Asked by: Guest | Views: 94
Total answers/comments: 3
Guest [Entry]

"Maybe this link helps you:

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

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

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).

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.

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.

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!"
Guest [Entry]

"I know this is an old question, however, I've just found how to do this with Windows/TortoiseSVN.

As a comment suggested, you can't ""delete"" a revision, but what you can do is make a more current revision that is the same as the revision you want to revert to.

Checkout the HEAD of the repository for the directory you want to revert the revision from.
Load the ""Show Log"" view in TortoiseSVN for the highest level directory you want to revert (e.g. ""Trunk"").
Right-Click the revision you want to remove NOTE: this is the revision you want to remove, not the one you want to revert to.
Select ""Revert changes from this revision"".
Click ""Yes"" at the prompt.
Update the checkout as normal, but to ""HEAD"".
Commit it back.

You will then to go to everyone else who has it checked out and get them to update and make sure to remove any new files.

Also, you'll need to make sure that everyone knows what that revision was and potentially update the description."
Guest [Entry]

"Go to the terminal and navigate to the svn repsitory:
now type

svn update -r ""revision number you want to revert"""