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.
More like this
- Git undo part of a commit
- Undo a git add - remove files staged for a git commit
- Drush subversion integration: svn add and svn commit following pm install
- Git revert a commit
- Disabling or moving node/add/[content-type] links from beneath "Add content" in the navigation menu also removes them from the Add content page (node/add)


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