Science, asked by Adilahusin9602, 1 year ago

How to revert the code back from particular revision in SVN?

Answers

Answered by gourab2717guha
0

Basically you need to "merge backwards" - apply a diff between the current and previous version to the current version (so you end up with a working copy looking like the old version) and then commit again. So for example to go from revision 150 (current) back to revision 140:

svn update

svn merge -r 150:140 .

svn commit -m "Rolled back to r140"

Thank u...


gourab2717guha: Sorry I rated my answer by mistake.
Answered by Anonymous
0

The reason you can't do anything directly with the good copy you have on your PC, is that its .svn folders know that it is code from the past, so requires an update. But you can only actually commit changes at the head of the subversion history.

You can use

svn update -r <earlier_revision_number>

to check various older versions of your project, until you find the right revision number, of your good version. When you have found it, update to the newest (head) revision, then apply the svn merge as suggested above.

If you really can't find it, and need to commit the copy on your PC, then get a fresh update to the latest version, and copy your "good" version over the top of it (without the .svn folders!). Delete any files that weren't in the good copy from the folders and from subversion, and commit what you have now.

Similar questions