SVN Undo Operation

From TrustWiki

Jump to: navigation, search

SVN Undo Operation


Step 1: Get the current version info of the file

$> svn info myfile
....
Revision:74



Step 2: You can get the previous correct version of the file

 $>svn log myfile

Now assume that the previous version of the file is 71

Step 3: Merge back the changes from the old version

svn merge --revision 74:71 .


Step 4: Check what the changes will be rolled back

svn diff 

Step 5: If you are satisfied, check in

svn ci -m "rolling back change" myfile


NOTE: The above example talks about rolling back a file. But you can actually roll back all the changes that you made to a set of files, as you are dealing with revision numbers. So the above works as it is for a set of files with unwanted changes that were checked in and need roll back.

Personal tools