On Fri, Jan 30, 2026 at 9:12 PM Sunil Matta <[email protected]> wrote:

> svn: version 1.14.5 (r1922182)
> OS: Linux Fedora 42
>
> I had deleted a directory in svn using svn del <working directory>
> followed by a commit on that delete.
>
> svn committed the delete, giving me a revision number.
>
> The files are still on my working directory but an svn list of the
> file:///home/svn-repo/__project_path__/trunk shows empty.
>
>
> Trying to revert using the svn path,
> svn revert file:///home/svn-repo/__project_path__/trunk
> doesn't work.
>

>
> Looked in the svn red bean book, couldn't finding anything on undoing a
> delete post commit.
>
> Is it possible to undelete those files in svn? i.e Is it possible to
> revert to the state of directory prior to the delete revision number?
>


Yes, it is possible! All information that has been committed to the
repository can be accessed again, and any changes made to that information,
including deletion, can be reversed.

It sounds like you were looking for the answer in the "Basic Usage" chapter
of the red bean book. That section explains 'svn revert', and it would seem
the most logical place to look!

However, 'svn revert' only reverts working copy changes that haven't been
committed yet.

Since the deletion has been committed, what you need are the sections on
Undoing Changes and (the one right after it) Resurrecting Deleted Items:

https://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo

https://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.resurrect

Perhaps somewhat confusingly, these are not in the Basic Usage chapter, but
rather are located two chapters later in Branching and Merging. This is
because Subversion tries to keep the number of subcommands to a minimum,
and to utilize the same subcommands for multiple different purposes, and so
the same commands used for branching and merging can be used for bringing
back older revisions of files and directories.

Those two sections of the book will explain that you can restore your
deleted files in one of two ways:

- One way is to use 'svn merge' with the '-c' ('--change') option with a
negated revision number, to take the changes in that revision and apply
them in reverse to your working copy; since the change was to delete files,
applying it in reverse will restore those files. You'll have to verify the
outcome in your working copy is what you want and, if so, commit that in a
separate step.

- Another way is to use the 'svn copy' command to copy the deleted files
from the last revision where they existed, into your working copy. Again,
you'll have to verify the outcome and commit in a separate step.

I suggest to read those two sections and see which way is better in this
scenario. (It depends largely on whether there were other changes in that
revision that you don't want to undo.)

Hope this helps. Feel free to ask for more help if you need it...

Nathan

Reply via email to