0

I'm working on a Rails app with SVN. I just ran 'svn up' from within app/assets/javascripts. That resulted in the whole repo being downloaded and copied into app/assets/javascripts, so I then had app/assets/javascripts/app, /lib, /Gemfile.lock, etc. I went ahead and deleted all these files, but now 'svn st' lists them all as locally deleted. I'm used to using Git, so I didn't realise that 'svn up' was sensitive to the current working directory like that. How do I fix this?

If I 'svn rm' them all and then commit, will this mess up the remote repo?

Gus Hogg-Blake
  • 2,393
  • 2
  • 21
  • 31
  • "I didn't realise that 'svn up' was sensitive to the current working directory like that" - AFAIK, it is not. If you run "svn info" from your subfolder, you will see that "URL" and "Repository Root" values are different. If you do not have any important local modification, just checkout fresh working copy in new folder. – Ivan Jovović Feb 15 '15 at 12:45

1 Answers1

0

If you deleted files on your working copy that are tracked by svn, you can undelete them by calling

svn revert path/to/deleted/file

If you want to restore all files that were accidentally deleted in your svn directory, this one-liner will do the trick for you:

svn status | grep '^!' | awk '{print $2}' | xargs svn revert

Generally, the revert subcommand will always restore your local files to the state of their last commit.