Cancel svn changes 1276-1284 and 1286-1294

I'm on rev 1307 now. I want to undo changes to change sets 1276-1284 and 1286-1294. Basically, these are all changes 1276-1294, with the exception of 1285. I would also like to keep my latest changes, which are unlikely to contradict the changes that I want to cancel.

Can someone give me some advice?

+4
source share
2 answers

In general terms, you can apply reverse diff for each range that you want to cancel. For instance:

svn diff -r1276:1285 > first.patch 

to create a diff (note that the final version is a version number greater than the last one you want to undo), then

 patch -R < first.patch 

The -R switch tells patch apply the patch in reverse order. svn diff tells you what you did, so patch -R cancels this. Of course, you may have conflicts that you must resolve manually.

+3
source

I think you can just do a couple of merge commands with changed revision numbers. Try the following:

 svn merge -r 1294:1285 svn merge -r 1284:1275 

I would recommend that you make your current changes before trying to do this, or at least create a patch file to back them up.

+1
source

Source: https://habr.com/ru/post/1310299/


All Articles