The Undelete command of the tf command-line feature schedules specified files or folders for restoration pending the completion of a check-in operation. It also retrieves the specified items from the server to the local disk unless you explicitly include the /noget option.
When files or folders that have the same name have been deleted from the same server folder, you must include a value for the deletionID parameter to indicate which of the deleted items that you want to restore. You can obtain a deletionID using the dir command.
To undelete an item into a server folder where an item with that same name already exists or is pending addition, you can use the /newname option to give the undeleted item a new name. You can undelete only one item at a time using the /newname option.
If you want to change the file after restoring it, you may check out the file for editing with the checkout command as usual.
When your itemspec specifies a folder, Team Foundation restores all its files and subfolders and the files they contain, by default. If you do not want to restore all the items in a folder, you must first undelete the folder and its items and then delete the items that you do not want to keep.