views:

58

answers:

4

I accidentally committed some changes to the repository that were not complete. I do not want to lose my local changes, but i want to revert the file in the repository to where i was before i committed the changes.

+3  A: 

The only choice is to backup your changes then do the reverse merge on the server then copy your changes back into your working copy.

Matt T
+6  A: 

Not sure if there is a feature to do this. But what I would do is

  1. Take your file and copy it into a separate directory [like on your desktop].
  2. In your SVN directory, revert that specific file to the
    previous version.
  3. Commit that version so it's now the HEAD version.
  4. Get your file from the desktop and copy it back in, and overwrite it and don't check it
    in.
Jack Marchetti
Alright, thanks Jack.
Mike
A: 

I would recommend saving the specific files you committed to an external folder. Then revert the file in the repository and commit. Thereby resulting in the state from before you committed. Then take the files you saved and replace them so your copy has your local changes.

Kyra
A: 

Use the "switch" command in SVN. It's easy, and a trick worth knowing.

  1. If this is your first time, copy the whole directory somewhere safe, or use WinZip (use option to preserve directory structure).
  2. In your private branch (you DO have a private branch, right? If not, make one), make a copy of the branch in question, using the repository browser.
  3. Do a "switch" on your PC (called "switch" in TortoiseSVN) to point your local folder to the private branch.
  4. Check it in.
  5. Switch back to the original branch.
  6. Revert.
Chris Thornton