What you are asking for is not possible with a single subversion command.
To undo a specific commit, perform a reverse-merge like this: svn merge -c -BROKEN_REVISION
. A merge, however, can only be done on a working copy. This is because a merge might create a conflict and conflict resolution has to be done locally.
Also see the answers to How do I revert an SVN commit?
To have a single command that undoes a commit, you can write a script roughly like this:
# Skip this if you already have a working copy
svn checkout ${REPO_URL}/${BRANCH} ${WC_PATH}
# Undo the offending commit
svn merge --change -${BROKEN_REVISION} ${WC_PATH}
# Try to commit the changes
# In case of a conflict, this will fail; resolve and commit the change
# If you plan to build locally, you can skip this line altogether
svn commit --message "Undo ${BROKEN_REVISION}" ${WC_PATH}
This, of course, will download a working copy from the subversion server, undo the commit locally and attempt to upload the changes, creating a new revision in the process.
Note that it's a fundamental premise of subversion that any change to the repository will create a new revision. So no matter how and where you change things, the revision will be incremented. The only way around this would be to manipulate your repository using the svnadmin
command. See Delete all traces of a SVN commit