<p>Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.</p>

<p>What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes. How things change if good changes were made to same files as bad changes?</p>

<p>I am mostly looking a way to do this via Eclipse plugins (Subclipse or Subversive) but commandline commands are also interesting.</p>

[{'answer_id': 36063, 'author': 'Fernando Barrocal', 'author_id': 2274, 'author_profile': 'https://Stackoverflow.com/users/2274', 'pm_score': 6, 'selected': True, 'text': '<p>You have two choices to do this.</p>\n\n<p>The Quick and Dirty is selecting your files (using <kbd>ctrl</kbd>) in Project Explorer view, right-click them, choose <code>Replace with...</code> and then you choose the best option for you, from <code>Latest from Repository</code>, or some <code>Branch</code> version. After getting those files you modify them (with a space, or fix something, your call and commit them to create a newer revision. </p>\n\n<p>A more clean way is choosing <code>Merge</code> at team menu and navigate through the wizard that will help you to recovery the old version in the actual revision.</p>\n\n<p>Both commands have their command-line equivalents: <code>svn revert</code> and <code>svn merge</code>.</p>\n'}, {'answer_id': 36325, 'author': 'Nick Higgs', 'author_id': 3187, 'author_profile': 'https://Stackoverflow.com/users/3187', 'pm_score': 1, 'selected': False, 'text': '<p>The svnbook has a section on how Subversion allows you to revert the changes from a particular revision without affecting the changes that occured in subsequent revisions:</p>\n\n<p><a href="http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.undo" rel="nofollow noreferrer">http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.undo</a></p>\n\n<p>I don\'t use Eclipse much, but in TortoiseSVN you can do this from the from the log dialogue; simply right-click on the revision you want to revert and select "Revert changes from this revision".</p>\n\n<p>In the case that the files for which you want to revert "bad changes" had "good changes" in subsequent revisions, then the process is the same. The changes from the "bad" revision will be reverted leaving the changes from "good" revisions untouched, however you might get conflicts.</p>\n'}, {'answer_id': 62879, 'author': 'Mark Phippard', 'author_id': 7267, 'author_profile': 'https://Stackoverflow.com/users/7267', 'pm_score': 3, 'selected': False, 'text': '<p>I have written a couple of blog posts on this subject.  One that is Subclipse centric: <a href="http://markphip.blogspot.com/2007/01/how-to-undo-commit-in-subversion.html" rel="nofollow noreferrer">http://markphip.blogspot.com/2007/01/how-to-undo-commit-in-subversion.html</a> and one that is command-line centric: <a href="http://blogs.collab.net/subversion/2007/07/second-chances/" rel="nofollow noreferrer">http://blogs.collab.net/subversion/2007/07/second-chances/</a></p>\n'}, {'answer_id': 63185, 'author': 'kirlich', 'author_id': 7635, 'author_profile': 'https://Stackoverflow.com/users/7635', 'pm_score': 6, 'selected': False, 'text': '<p>In Eclipse Ganymede (Subclipse)</p>\n\n<p>Select project/file that contains bad change, and from pop-up menu choose:</p>\n\n<p><strong>Team -> Show History</strong></p>\n\n<p>Revisions related to that project/file will be shown in History tab.</p>\n\n<p>Find revision where "bad changes" were committed and from pop-up menu choose:</p>\n\n<p><strong>Revert Changes from Revision X</strong></p>\n\n<p>This will merge changes in file(s) modified within bad revision, with revision prior to bad revision. </p>\n\n<p>There are two scenarios from here:</p>\n\n<ol>\n<li><p>If you committed no changes for that file (bad revision is last revision for that file), it will simply remove changes made in bad revision. Those changes are merged to your working copy so you have to  commit them.</p></li>\n<li><p>If you committed some changes for that file (bad revision is not last revision for that file), you will have to manually resolve conflict. Let say that you have file readme.txt with, and bad revision number is 33. Also, you\'ve made another commit for that file in revision 34. After you choose <strong>Revert Changes from Revision 33</strong> you will have following in your working copy:</p></li>\n</ol>\n\n<p><strong>readme.txt.merge-left.r33</strong>    - bad revision</p>\n\n<p><strong>readme.txt.merge-right.r32</strong>   - before bad revision</p>\n\n<p><strong>readme.txt.working</strong>           - working copy version (same as in r34 if you don\'t have any uncommitted changes)</p>\n\n<p>Original readme.txt will be marked conflicted, and will contain merged version (where changes from bad revision are removed) with some markers (&lt;&lt;&lt;&lt;&lt;&lt;&lt; .working etc). If you just want to remove changes from bad revision and keep changes made after that, then all you have to do is remove markers. Otherwise, you can copy contents from one of 3 files mentioned above to original file. Whatever you choose, when you are done, mark conflict resolved by </p>\n\n<p><strong>Team - Mark Resolved</strong></p>\n\n<p>Temporary files will be removed and your file will be marked changed. As in 1, you have to commit changes.</p>\n\n<p>Note that this does not remove revision from revision history in svn repository. You simply made new revision where changes from bad revision are removed.</p>\n'}, {'answer_id': 117020, 'author': 'Matt', 'author_id': 20630, 'author_profile': 'https://Stackoverflow.com/users/20630', 'pm_score': 4, 'selected': False, 'text': '<p>If you want to do 1 file at a time you can go to the History view for the file assuming you have an Eclipse SVN plugin installed.  "Team->Show History"</p>\n\n<p>In the History view, find the last good version of that file, right click and choose "Get Contents".  This will replace your current version with that version\'s contents.  Then you can commit the changes when you\'ve fixed it all up.</p>\n'}, {'answer_id': 4106023, 'author': 'Tuukka Mustonen', 'author_id': 165629, 'author_profile': 'https://Stackoverflow.com/users/165629', 'pm_score': 3, 'selected': False, 'text': '<p>In Eclipse using Subversive:</p>\n\n<p>Right click your project > Team > Merge</p>\n\n<p>In the merge window, select the revisions you want to revert as normally but also enable checkbox "Reversed merge".</p>\n\n<p>Merge as normally.</p>\n'}, {'answer_id': 40214710, 'author': 'Gora', 'author_id': 7063574, 'author_profile': 'https://Stackoverflow.com/users/7063574', 'pm_score': 0, 'selected': False, 'text': "<p>I have same problem but CleanUp eclipse option doesn't work for me.</p>\n\n<p>1) install TortoiseSVN <br>\n2) Go to windows explorer and right click on your project directory<br>\n3 Choice CleanUp option (by checking break lock option)<br></p>\n\n<p>It's works.</p>\n\n<p>Hope this helps someone.</p>\n"}]
['https://Stackoverflow.com/questions/35983', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1431/']