0

Possible Duplicate:
How do I return to an older version of our code in Subversion?

I was looking at the diff in the commit window on Eclipse (with subclipse) and tried adding a line (by hitting enter) but instead committed by changes without a comment and without me making sure I wanted to commit the things I changed.

This added a commit with no comment and with changes I wasn't sure of to the remote repo. I checked out the previous revision and committed those changes over the commit I made accidentally.

So now HEAD is the same state as the revision before my accidental commit, but I would like to properly commit my changes now. I'm not sure how, though. When I switch to the accidental revision (to get my changes back), it doesn't let me commit because it says nothing was changed. I'm guessing it's comparing my local files to the revision I checked out, but I need it to compare it to HEAD.

What can I do here?

Community
  • 1
  • 1
mowwwalker
  • 16,634
  • 25
  • 104
  • 157

3 Answers3

0

You could (svn) export your accidentally committed revision over your working copy. Then you can make your adjustments and commit your changes.

On the command line:

svn export -r <your accidental commit> <working copy directory>

In Eclipse:

  • right click on the accidental commit in the history view
  • select "Export..." and choose the directory containing your working copy
Stefan Ferstl
  • 5,135
  • 3
  • 33
  • 41
0

The easiest thing would be to make a unified diff of the revision you committed and then use the Apply Patch option to reapply it to your workspace.

You can also just do Show History on the changed file. Then find the revision, select the file in the appropriate pane, and choose the Get Contents option. This will make your working copy version of that file match the contents of that file in the selected revision.

In either case, your working copy should now show as dirty and you can review and commit when ready.

Mark Phippard
  • 10,329
  • 2
  • 32
  • 42
0

I ended up reverting the changes from the very last commit I made and then re-committing those after checking everything.

mowwwalker
  • 16,634
  • 25
  • 104
  • 157