We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27376
    • 576 Posts
    So I commited a mistake a little while back on a single file in my repository, and I’d like to go back to before that mistake was commited. Here’s some more info:

    Mistake commited at r162
    Desired version at r161
    Current WC at r 165

    My idea was to run [tt]$ svn cp -r 161 file.php file.php[/tt] But it says ’file.php is in the way’.

    Is there a way I can go back to a revision of a file without having to first delete that file from the repository? My guess is that I would use [tt]$ svn merge[/tt] but what revision numbers do I use?

    Thanks!
      • 22303 MODX Staff
      • 10,725 Posts
      You’ll want to merge from the revision you want to "revert" the changes from, to the revision before it. This will effectively undo the changes made in that revision in your local working copy, which you can then commit as a new revision.

      i.e. to revert all changes from 2786 in a local working copy of branches/0.9.6
      svn merge -r2786:2785 http://svn1.cvsdude.com/rethrash/tattoo/tattoo/branches/0.9.6 /dev/xampp1.6.1/htdocs/modx096


      This is not the same as reverting all changes in your local working copy (see svn revert), nor of updating to a specific revision of the file in history (see svn update)
        • 27376
        • 576 Posts
        Thanks Jason! the merge worked great and it even judiciously kept all the commits that I made AFTER that mistake! Truly amazing.