If you accidently delete a file in Teams, from the documents folder in Teams, select the ellipse and then Open in SharePoint.

When SharePoint opens, select the Recycle Bin and then select the file you want to restore and select Restore