2

I accidentally added a file to my svn working copy that I don't want to check in (a test image). I haven't commited yet, so how do I remove the file from my svn working copy without deleting it?

C. Ross
  • 31,137
  • 42
  • 147
  • 238

3 Answers3

7

svn revert filename

Tamas Czinege
  • 118,853
  • 40
  • 150
  • 176
3

If it's in A state, then simple svn revert is what you need.

Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224
0

In case it happens to a folder you can use the same command adding the desired level to apply recursivity

svn revert --depth infinity [folder_name]

It may useful to add the folder to the ignore list in case you are interested in maintaining it under the same folder structure without worrying about an accidental add/commit. A helpful post about this aspect can be found here How do I ignore a directory with SVN?

João Quintas
  • 761
  • 2
  • 9
  • 18