Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

easiest way to undo one file change in svn

Tags:

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?

like image 559
Jason S Avatar asked Nov 30 '10 21:11

Jason S


2 Answers

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"
like image 180
pyfunc Avatar answered Sep 27 '22 22:09

pyfunc


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.

enter image description here

like image 27
yellavon Avatar answered Sep 28 '22 00:09

yellavon