You can recover a deleted team project in TFS only if your server administrator has not yet run the background job that permanently destroys it, or if you have a database backup that predates the deletion. The critical variable is which of four things was actually deleted — a team project, a project collection, a source-control folder, or a work item — because each has a different recovery path, a different window of opportunity, and a different set of tools. Work items and source files are the easiest to restore; a whole team project sits in a 30-day grace period by default; a destroyed project collection or a purged section of the retention job can only be rebuilt from a SQL Server backup.

This guide walks through each scenario in the order you should check them, assuming you have already logged in and found the project missing. Where a step touches server internals, it names the role that must perform it, because most TFS recovery actions are not available to ordinary project members.

First, identify exactly what was deleted and whether a grace period still applies

Before touching any tool, establish two facts: the object type and the time elapsed. TFS treats deletion as a two-stage process. The first stage marks an object as deleted and removes it from normal views. The second stage — a background cleanup job — removes the underlying data permanently. The interval between them is your recovery window, and it differs by object type.

Deleted object Default retention before permanent destruction Who can restore it Primary recovery route
Team project 30 days (server setting) Project collection administrator Admin console or TfsDeleteProject reversal via restore tools
Team project collection 30 days (server setting) TFS administrator with server access SQL restore or collection re-attach
Source-control folder or file Retained until the destruction job runs User with Destroy permissions, then admin Undelete from Source Control Explorer, pending destroy rollback
Work item Retained in the database until destroyed Project member with delete/restore rights Recycle Bin view in the work item area

The 30-day figure is the default for team projects and collections; an administrator can change it. Confirm the actual value on your server before assuming you have time. If more than the configured interval has passed and no backups exist, the data is genuinely gone — say so early rather than spending hours on tools that cannot help. If you do not know who administers the server, the fastest path is to ask your IT or DevOps team for the TFS application-tier contact before doing anything else.

Recovering a deleted team project within the retention window

A deleted team project is the most common reading of your question, so start here. Within the retention period, restoration is an administrative action, not a self-service one. You will need project collection administrator rights, or a colleague who has them.

1: Ask your TFS administrator to open the administration console for the team foundation server and locate the deleted project under the collection's project list. The console shows projects marked for deletion separately from active ones. 2: Have the administrator select the project and choose the restore option. The exact label varies by TFS version, so confirm the screen wording on your installed version rather than guessing — in older administration consoles it appears as a "Restore" action on the deleted project entry. 3: Wait for the restore job to complete. Large projects can take minutes to tens of minutes depending on database size and server load. 4: Verify success by connecting from Visual Studio or your browser client and confirming the project appears with its team sites, build definitions, and repositories intact.

If the restore option is not present, the retention window has likely closed or the project was destroyed manually. In that case, move to the backup route described further down.

Undeleting source-control files and folders in TFS

Source-control deletions behave differently from project deletions because TFS keeps deleted items addressable through the version history. A file or folder removed with a normal delete operation can usually be undeleted without any admin involvement.

1: Open Source Control Explorer in Visual Studio and navigate to the parent folder where the deleted item used to live. 2: Enable the option to show deleted items. In Visual Studio's Source Control Explorer this is a view toggle; the label differs between Visual Studio versions, so check the view menu on your installation for "deleted" visibility. 3: Right-click the greyed-out deleted item and select Undelete, then check in the pending change. 4: Confirm the file reappears with its history intact by opening its History view.

The catch is the destroy operation. A user with Destroy permission can permanently remove a file's data even though the version metadata remains. If a colleague ran destroy rather than delete, undelete will fail with an error stating the item cannot be found or has been destroyed. That symptom points to the database backup route, not to a permissions problem — do not waste time re-requesting permissions.

Restoring work items from the TFS recycle bin

Work items are the most forgiving case. TFS keeps deleted work items in a recycle bin scoped to the team project, and a project member with the right permissions can restore them without server access.

1: Open the work item query view in your browser client or Visual Studio and switch to the recycle bin view for the project. 2: Filter by the work item type, title fragment, or the date range around the deletion, since the bin can hold a large number of items. 3: Select the items and choose restore. Restored items return to their previous state, though links to items that were also deleted may need re-checking. 4: Verify by running the original query that surfaced the items before deletion.

Work items can also be permanently destroyed by an administrator, which bypasses the recycle bin entirely. If the bin is empty and you are certain items existed, ask whether a destroy operation ran recently.

When the retention period has passed: restore from a SQL Server backup

Once the cleanup job has run or an administrator has destroyed the data, no TFS interface can bring it back. The only reliable route is a database backup taken before the deletion. This is a server-administrator task and carries real risk, so it should be done by someone experienced with TFS backups.

The practical sequence is: identify a full backup of the collection database that predates the deletion; restore it to a separate SQL Server instance rather than over the production database; attach or mount that restored collection to a non-production TFS instance; then export the recovered project or files and import them into production. Restoring over the live database is the mistake to avoid — it can take the entire collection offline.

Two edge cases matter here. First, TFS backups must be transactionally consistent across the configuration database and collection databases; restoring one without the other can leave the collection unattachable. Second, the sharepoint and reporting components of a team project are backed up separately, so a database-only restore may return code and work items but not dashboards. Check what your backup regime actually covers before promising a full recovery.

Recovering a deleted project collection

A project collection is a larger unit than a project, and deleting one removes every project inside it. The 30-day retention applies by default, but the restore path is different: collections are detached and re-attached rather than toggled back on.

1: Have the TFS administrator confirm the collection is marked deleted but not yet destroyed, using the administration console. 2: Restore the collection database using the backup procedure above if the retention window has closed. 3: Re-attach the collection to the application tier, then verify each contained project is reachable.

If the collection was destroyed and no backup exists, there is no supported recovery. State that plainly to stakeholders early; continuing to hunt for a tool wastes the time you could spend rebuilding from source copies on developers' machines.

What you can do yourself versus what needs a server administrator

Most readers asking this question are project members, not administrators, so it helps to know where your权限 ends. The table below separates self-service actions from escalation.

Action Typical permission needed Can a regular contributor do it?
Restore work items from recycle bin Edit/restore rights on the project Usually yes
Undelete source files (not destroyed) Contribute on the folder Usually yes
Restore a deleted team project Project collection administrator No
Roll back a pending destroy Admin plus Destroy permission No
Restore from SQL backup Server/database administrator No

Escalate with specifics. Tell your administrator the object name, the approximate deletion time, and whether you know a destroy operation ran. That information determines which of the routes above applies and saves a round trip.

Common failure cases and how to tell them apart

Recovery attempts fail for a small number of predictable reasons. Match the symptom to the cause before changing approach.

If the restore option is missing from the admin console, the retention interval has elapsed. If undelete reports the item as destroyed, a destroy operation ran and only a backup helps. If a restored project attaches but shows empty repositories, the collection database was restored without its corresponding configuration data. If work items restore but links are broken, linked items were destroyed separately. Each of these points to a different escalation, and none of them is fixed by retrying the same step.

A useful stop condition: if two different administrators confirm no backup predates the deletion and the retention window has closed, further recovery work is futile. At that point the honest answer is to rebuild from local developer copies, which is why source control hosting outside a single TFS instance is worth considering for the future.

Frequently asked questions

Can I recover a project after the 30-day window if I have no backup? No. Once the cleanup job or a destroy operation removes the data and no database backup exists, TFS has nothing to restore. The 30 days is a default that administrators can change, so confirm the configured value on your server — a longer setting gives you more time.

Does deleting a project delete its source code permanently? Not immediately. The code remains in the collection database during the retention window and is recoverable through the project restore route. Permanent removal happens only when the cleanup job runs or an administrator destroys the data.

Will restoring a project bring back build history and work items? Usually yes within the retention window, because those records live in the same collection database. After a partial backup restore, reporting and dashboard data may be missing because those components are backed up separately.

Who should I contact first? Your TFS or DevOps administrator. Give them the project name, deletion date, and any knowledge of a destroy operation; that determines whether the fix is a console restore, an undelete, or a database restore.

This article is general technical information about TFS recovery behavior, not a guarantee of recovery in your environment. Recovery outcomes depend on your server's retention settings, backup regime, and permissions. Consult your TFS administrator or a qualified database professional before attempting any restore against production data, and keep tested backups as your only reliable safeguard.