easiest way to undo one file change in svn
Let's say I have the following situation:
myrepo/
foo.txt
bar.txt
baz.txt
quux.txt
bingo.txt
In rev 419, I changed foo.txt, bar.txt, and bingo.txt.
Now I discover an error and I would like to keep foo.txt from rev 418, but leave the changes in bar.txt and bingo.txt from rev 419 intact, so I can开发者_如何转开发 commit rev 420 so its foo.txt is the same as rev 418.
How can I do this with a minimum of hassle?
This is how, I have rolled back the changes of a previous commit.
The reverse merge : svn --revision (version to revert):(version below it) <. or filename>
svn merge --revision 419:418 foo.txt
svn commit -m "Reverting commit ver:419 for foo.txt"
If you are using TortiseSVN, you can right click on the file in question and click "Show Log". In the commit log, find the revision for the file you want to revert, right click the file and click "Revert changes from this revision". Then commit the change to your branch.
精彩评论