Home ›
Undo that SVN addUndo that SVN add
Submitted by Benjamin Melançon on June 11, 2007 - 8:10am
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