Jun 15, 2010

Rollback Subclipse - Revert Subversion Changes

Problem

You need to rollback/revert subversion to a previous version and you're using the Subclipse plugin for Eclipse (or Flash Builder 4, etc.) to do it.

Symptoms

  • There have been many changes to your project. You want to "undo" all those changes, restoring your project to its former glory.
  • Choosing "Revert" only blew away your local changes. That's not good enough.
  • There's a particular point in the past where everything "worked" and you need to reset everything back to that revision.

Solution

  1. Right click your top level project folder and choose "Team" > "Show History"
  2. Find the point in the past where things worked
  3. TIP: click the play button on the top left to "show the next 25" revisions
  4. Highlight all revisions AFTER the target revision
  5. Right click and choose "Revert changes from revision # to revision #"
  6. That's it. Commit your changes

For me, the revision that worked was revision 3690. The revision I was on was 3765. So, I highlighted revisions 3691 to 3765, right clicked and chose "Revert changes from revision 3765 to 3691."

From there, I wanted to keep certain changes so I right clicked my project folder and chose "Compare With..." > "Latest From Repository". This opened a view of every single file in the project that was altered. I double-clicked the files with useful changes, copied the changes I wanted over and saved the compare editor.

After everything looked correct, I committed. Worked great.

3 comments: