I absent mindedly mv a folder in my svn trunk instead of branching it. I could just mv it back, but I'm afraid I'd lose history. How is this best undone?
Edit: I should be clear that I did the move on the repository, not my working copy, so it was an automatic commit.
Right click on the selected revision(s), then select Context Menu → Revert changes from this revision. Or if you want to make an earlier revision the new HEAD revision, right click on the selected revision, then select Context Menu → Revert to this revision. This will discard all changes after the selected revision.
If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert.
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.
See the subversion manual about Undoing Changes in order to undo your erroneous changes.
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 303:302, or by an equivalent --change -303.)
svn merge -c -303 http://svn.example.com/repos/calc/trunk
If you want to revert so it is as if the move never happened then you need to dump the whole repository up to the revision you want and then recreate the repository.
Check out here and here for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With