If you deleted a file from Files or Sharepoint tab, follow the steps below.
Open Teams
Select Team and where the deleted file belonged
Select Channel where the deleted file belonged
Select Files tab
Select Open in SharePoint
SharePoint site will open
Select Recycle bin from the left menu bar in SharePoint
Right Click on the deleted file and select Restore
Finally confirm the restoration of file