Chris
Chris

Reputation: 2896

Overwrote .svn files, how to undo

I wanted to change the all occurrences of a string in a directory and its children in some subdirectory of my SVN repo. I used a perl from the command line to replace all occurrences in files matching file . - type f. I did svn diff to see what changed, but svn did not tell me anything was different. I realized this was because the history was stored in the .svn directory (I'm a git user and didn't think of this...), and my perl command replaced all occurrences in the .svn history as well (I'm guessing anyway).

Whats the easiest/best way to get the correct .svn directories (for subdirectories as well) without losing my changes?

Upvotes: 0

Views: 65

Answers (1)

Jim W
Jim W

Reputation: 5016

I would export (using svn) the directory to somewhere safe - then go back and delete the contents of the broken directory (including the .svn dir). Then svn->update on the parent, this should put the last committed version back on your machine. Copy the exported (ie up to date) version of the directory back to the original dir and replace the files (ie put the newer files back over the old files).

Before you do that - test it on something unimportant :)

Upvotes: 1

Related Questions