Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I revert an SVN commit?

Tags:

revert

svn

I have found various examples of how to revert an SVN commit like

svn merge -r [current_version]:[previous_version] [repository_url] 

or

svn merge -c -[R] . 

But neither of them seems to work. I tried those commands and checked the files that were changed by hand.

How do I revert a commit with revision number 1944? How do I check that the revert has been done (without looking in the actual file to the changes have been reverted)?

like image 290
Alex Avatar asked Nov 11 '12 09:11

Alex


People also ask

How do I revert a commit in svn?

To revert a single commit: Go to: Subversion -> Integrate Directory... Show activity on this post. Note that the svn merge command reverts a commit in the sense of having another commit undoing your changes, but keeping your wrong commit in the history.

What does Revert command do in svn?

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

How do I undo a merge in svn?

You can use svn merge to “undo” the change in your working copy, and then commit the local modification to the repository. All you need to do is to specify a reverse difference. (You can do this by specifying --revision 392:391 , or by an equivalent --change -392 .)


2 Answers

Both examples must work, but

svn merge -r UPREV:LOWREV . undo range

svn merge -c -REV . undo single revision

in this syntax - if current dir is WC and (as in must done after every merge) you'll commit results

Do you want to see logs?

like image 184
Lazy Badger Avatar answered Sep 23 '22 01:09

Lazy Badger


If you're using the TortoiseSVN client, it's easily done via the Show Log dialog.

like image 41
dodgy_coder Avatar answered Sep 22 '22 01:09

dodgy_coder