Page 1 of 1

Is it possible to undo a Commitment on SVN?

PostPosted: Mon Oct 07, 2013 10:00 pm
by ErikBeltran
Hi Everyone,

We currently are running SyncSVN 8.0 and by mistake I committed the wrong files to the repositories :cry: - is there a way to remove those files from the Incoming Tab of the SVN App?


Thank you,
Erik Beltran

Re: Is it possible to undo a Commitment on SVN?

PostPosted: Tue Oct 08, 2013 9:01 am
by Florin
Hello,

You cannot undo a commit in the way we know undo operations usually work, but you can roll-back the changes. This means that your original commit remains in the repository and you will have to do a new one (a new revision) in order to remove the previous changes.

To roll-back changes in SVN, use svn merge, with the following syntax:
Code: Select all
svn merge -c revNo workingCopyFilePath

This means that changes made in revision revNo will be undone from file workingCopyFilePath. After, the file must be committed again.

Using Syncro SVN Client, you have two options:
  • If you want to revert all changes in a specific revision (for all files committed in that revision):
    1. request history for the working copy root or for the most closer ancestor directory of the committed files;
    2. locate the revision of interest and select it;
    3. use Revert changes from this revision;
    4. make sure everything worked fine - check the changes;
    5. commit the files that were modified by the action.
  • If you want to revert only the changes from some specific files (not for all files committed in a revision, but for a part of them), then you can use Tools > Merge for each file of interest:
    1. select one of the files you want to revert changes for;
    2. use the specified action;
    3. select Merge revisions and advance to the next options page;
    4. input the repository URL of that file. You can also use Browse button to locate it in the repository.
    5. select Revision range option and input the revision you want to roll-back changes for (or use History button to easily identify it);
    6. select Reverse merge option. This is mandatory, if you want to roll-back changes, else there will be no change to the file.
    7. press Merge button (skip next options page);
    8. check the file, to see if changes were reverted;
    9. repeat steps 1-8 for the other files;
    10. commit the files for which you reverted the changes.

Since the first option is easier, you can also use it to revert changes only for some of the files committed in a revision (like in the second case): use the option from History view and, after, Revert the working copy changes that you do not want to be rolled back from the repository. This can be useful when you want to roll-back most of the changes in a revision, except some of them (a small part).

Best Regards,
Florin Avram
----------------------
Syncro SVN Client Team