How to recover deleted site in WordPress Multisite?

http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/includes/ms.php#L46

Notice, how drop defaults to false; this means that the blog tables are not removed. Deleting is triggered from over here: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/ms-delete-site.php#L19 and nowhere else by default. Unless you have a plugin that forces drops on the tables there’s still a chance to recover something.

First of all backup the database before attempting anything.

To get the blog to be displayed in the list you have to reverse the following action:

update_blog_status( $blog_id, 'deleted', 1 );

You can do this manually via MySQL:

UPDATE `wp_blogs` SET `deleted` = 0 WHERE `blog_id` = '##'

Or update_blog_status( ##, 'deleted', 0 ); in your functions.php once.

The users will, unfortunately be gone, due to this in a loop:

remove_user_from_blog( $user_id, $blog_id );

…performing even if the tables aren’t dropped.

The rest – settings, files, etc. should be all intact.

Good luck.