Tarun Arora is a Microsoft Certified professional developer for Enterprise Applications. He has extensively traveled around the world gaining experience learning and working in culturally diverse teams. Tarun has over 6 years of experience developing 'Energy Trading & Risk Management' solutions for leading Trading & Banking Enterprises. His passion for technology has earned him the Microsoft Community Contributor and Microsoft MVP Award.

Have you accidently deleted files from TFS and are looking at a way to undelete the file? You don’t have to undo your previous check in to get the files back, there is a simpler way.

01 – View Deleted items in Team Explorer

Have you been wondering how you can view deleted items in Team Explorer? Well, go to tools, options, Source Control. From Visual Studio Team Foundation check ‘show deleted items in the Source Control Explorer’.

02 – Undelete files from TFS

Simply right click the deleted file or folder and from the context menu select ‘Undelete’. This will roll back the files to the version before the delete operation was committed on them.

The undeleted changes now show up as pending changes in your workspace. You need to right click the folder and select Check In Pending changes from the context menu to restore the files.

Add a comment and check in the files back to TFS to undelete them

Right click the folder and view history. You’ll see both the check in that deleted the file/folder and the check in that restored it.

So, that’s how you can restoring deleted files in TFS… Nice and simple… Right?