User login

Undo that SVN add

In Subversion, to cancel an svn add example_folder command before committing to the repository, do not use svn delete or svn remove or made-up stuff like undo or cancel.

Use the svn revert command:

svn revert --recursive example_folder

And all will be well.

Update: Commenter says this can lose local changes. Not sure about that, but my use case was indeed to get rid of everything so i didn't care. And i'm on Git now.

Comments

Thank you

I just made some wrong svn rm, and your post here save me to undo it.

Consider

This will revert all edits you may have made to other files that already were under version control. Those edits that you'd loose for good as they are not yet in the repository.

Thanks a lot

This revert, of course this time followed by 'svn add --non-recursive my_folder' worked a treat.

Simon

Thanks!

Really useful :)

Revert safe for uncontrolled files

svn reverting on files added but not yet committed will not change those files. svn reverting files under version control will revert the file to the version in the given revision of the repository. As long as the files you just added are not under version control in the first place svn revert will be safe.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.