
Really good and detailed explanation of the revert process from aralbalkan. Take your time, make sure you use diff to see what changes have been made and check again when your through 🙂 One final point, be super careful with a merge, things can get real messy! Svn -m 'turn off db errors again' commit some_root_dir/update-data.php Now commit the working copy to include this change and all’s well in the world again. Use a diff to see the changes made after the merge and you should see that the change(s) made have been undone. If the size of the generated diff (in bytes) is larger than this figure then it is. If showing the diff (see showdiff), this determines the maximum size of the diff that will be shown. The following configuration options may be specified in config.yaml. +++ update-data.php (working -6,7 +6,7 = true Returns the difference between two revisions of the same file. Svn merge -r 4057:4056 some_root_dir/update-data.php some_root_dir/update-data.php Now execute the merge command to revert to previous revision. Svn merge -dry-run -r 4057:4056 some_root_dir/update-data.php some_root_dir/update-data.php

You will need to pass in a destination or working copy path to the merge command, so change the command above to… Svn: Cannot replace a directory from within Svn: REPORT request failed on '/!svn/vcc/default' Svn merge -dry-run -r 4057:4056 some_root_dir/update-data.php You should try a dry run to see what a the outcome of a merge will be before you execute the real merge.

In this case, you will need to merge the changes from your current revision back to the revision you want to revert to. However if there were too many changes to do yourself, you may prefer to revert to the last known good revision. Now you can make a change to the working copy and commit a fix. Sometimes this is all you need, as you can see the mistake you made. +++ update-data.php (revision -6,7 +6,7 = false

Use diff command to see the difference between the 2 revisions. Use the log command to get the info from previous commits including revision numbers.
SVN DIFF BETWEEN REVISIONS CODE
If you have ever deployed code from a SVN repository with a bug in it and you need to revert to a working revision then you may find the following handy.įirst find the revision numbers for the file(s) in question.
