简体   繁体   中英

svn undo old commit, keep newer ones

I know I can do a reverse merge. But that seems like it is good for undoing the most recent commit. I have a more complex problem:

r100 - I want to undo this one
r101 - Keep
r102 - Keep
r103 - Undo this one as well
r104 - Keep
r105 - Keep
r106 - HEAD

Is there an easy way of doing this? r103 modifies r100, others modify different files.

我会尝试这样做:使用反向合并撤消r103,然后使用反向合并撤消r100。

Notice that you cannot remove committed revisions from the repository, however you can let SVN automatically modify your local working copy in a way that it reverts a revision or a range of revisions. That is eg, if you added a line, it will remove it in your working copy, if you had removed a file, it will add it again etc.

See Nanne's answer for the command-line version of doing this. In TortoiseSVN on Windows, just click "Undo changes from this revision" in the log window.

AFter that, simply commit the changes in your working copy.

You can not easily remove past commits in an SVN repository.

Please see this question in the SVN FAQ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM