Login | Join Now

Subversion Knowledge Base

4. "Revert" is the other option to "delete and update"!

Products: Subversion 
Version: 1.3
First created: 10/13/06
Last updated: 10/18/06
Document number (KB 4)

Summary

You could make use of the "Revert" command to undo the changes we made to a file  .

"Revert" is the other option to "delete and update"!

If you've ever made changes to a file in your CVS working copy that you wanted to undo without committing, you probably did something like this to rectify the situation:

$ rm I-made-a-boo-boo.txt
$ cvs up

I-made-a-boo-boo.txt
U I-made-a-boo-boo.txt

And that, aside from requiring two separate operations, required a trip to the server to get the unblemished file (which, by the way, may not be the original file you were working on but rather a newer version). Subversion, however, stores a pristine copy of each file in the .svn directory, so you can just do this:


$ svn revert
I-made-a-boo-boo.txt

Reverted 'I-made-a-boo-boo.txt'

That comes in especially handy if you don't have an Internet connection at the time.

 

Support from CollabNet
Services from CollabNet