I accidentally committed too many files to an SVN repository and changed some things I didn't mean to. (Sigh.) In order to revert them to their prior state, the best I could come up with was
svn rm l3toks.dtx
svn copy -r 854 svn+ssh://<repository URL>/l3toks.dtx ./l3toks.dtx
Jeez! Is there no better way? Why can't I just write something like this:
svn revert -r 854 l3toks.dtx
Okay, I'm only using v1.4.4, but I skimmed over the changes list for the 1.5 branch and I couldn't see anything directly related to this. Did I miss anything?
Edit: I guess I wasn't clear enough. I don't think I want to reverse merge, because then I'll lose the changes that I did want to make! Say that fileA
and fileB
were both modified but I only wanted to commit fileA
; accidentally typing
svn commit -m "small change"
commits both files, and now I want to roll back fileB
. Reverse merging makes this task no easier (as far as I can tell) than the steps I outlined above.
To undo a specific revision you can use the following command: $ svn merge -c -r3745 . In case you have other edited files in working directory, you can commit only the relevant files. Please note that undoing actually will mean you create a new revision with the negatives changes of last commit.
svn revert will revert not only the contents of an item in your working copy, but also any property changes. Finally, you can use it to undo any scheduling operations that you may have performed (e.g., files scheduled for addition or deletion can be “unscheduled”).
Display the differences between two paths. The ways you can use svn diff are: Use just svn diff'to display local modifications in a working copy. Display the changes made to TARGET s as they are seen in REV between two revisions.
svn merge -r 854:853 l3toks.dtx
or
svn merge -c -854 l3toks.dtx
The two commands are equivalent.
Check out "undoing changes" section of the svn book
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