<< December 24, 2007 | Home | December 26, 2007 >>

Deleted a File by Accident?

Reverting Subversion Commits

You have deleted a file or directory and commited your change by accident? Subversion lets you undo your change quite easily.

Use svn merge -c -<revision> <URL> in your working directory. If you have local changes that you want to commit later do a fresh checkout of <URL> to a temporary directory and run svn merge there. After running svn merge you must commit your working directory for the undo to become effective.

As this completely reverses your change the same procedure can be used to recover a deleted directory or to undo other unwanted changes.

For more information see the undo section in Version Control with Subversion.

Tags :