Undo svn changesets 1276-1284 and 1286-1294
Right now I'm at rev 1307. I want to undo the changes of开发者_如何学C the changesets 1276-1284 and 1286-1294. Basically, it's all the changesets 1276-1294, excluding 1285. I would also like to keep my latest changes, which are unlikely to conflict with the changes that I want to undo.
Can anybody give me some hints?
In general terms, you can apply a reverse diff for each range you want to undo. For example:
svn diff -r1276:1285 > first.patch
to create the diff (note the ending version is one revision number more than the last one you want to undo), then
patch -R < first.patch
The -R
switch tells patch
to apply the patch in reverse. svn diff
tells you what you did, so patch -R
undoes that. You may, of course, have conflicts that you must resolve manually.
I think you can just do a couple of merge commands with the revision numbers reversed. Try this:
svn merge -r 1294:1285
svn merge -r 1284:1275
I'd recommend you commit your current changes before trying this, or at least create a patch file to back them up.
精彩评论