Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Last active February 1, 2019 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinewalker/5c0e4c9df75d2c4244d03f3c59947dc7 to your computer and use it in GitHub Desktop.
Save sinewalker/5c0e4c9df75d2c4244d03f3c59947dc7 to your computer and use it in GitHub Desktop.
Revert all deleted files in SVN

SVN doesn't seem to let you revert multiple files with a wildcard (or say if you deleted a whole directory tree in error)?

This works:

svn status|awk '/^D/{system("svn revert " $2)}'

There's probably another way....

@sinewalker
Copy link
Author

sinewalker commented Feb 1, 2019

system is a GNU awk thing. If your awk doesn't have that, then print and pipe through xargs:

svn status|awk '/^D/{print $2}'|xargs svn revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment