Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn: reverting to previous version

Tags:

svn

I mistakenly committed the wrong change to file, for a simplified example's sake let's call it foo.txt:

foo.txt, rev 300 (correct):

 E = mc^2

foo.txt, rev 301 (incorrect):

 E = mc^3

How do I re-commit rev 300 to the next commit? If I update foo.txt to rev 300, I get the right file but its status is correct & doesn't require being committed.

NOTE: It's only foo.txt that I want to revert. The other revisions in rev 301 are important and I need to keep them.

like image 363
Jason S Avatar asked Sep 27 '10 20:09

Jason S


People also ask

What does svn revert do?

Reverts any local changes to a file or directory and resolves any conflicted states. svn revert will revert not only the contents of an item in your working copy, but also any property changes.


1 Answers

svn merge -r301:300 foo.txt
svn commit -m 'revert foo.txt to 300'
like image 114
DigitalRoss Avatar answered Sep 17 '22 11:09

DigitalRoss