You don't have to worry, I'm here to help so you'll be able to recover the invoice that was deleted accidentally.
To recover the invoice, you can simply recreate it with the same information/data with the deleted one. If you don't have the information, you can visit the Audit Log page and look for the invoice from there.
Log in to your QuickBooks Online (QBO) account.
Click on the Gear icon.
Click on Audit Log under Tools.
On the AuditLog page, make the necessary filter/s, then select Apply.
Look for the added invoice with the invoice number and click on View under the History column.
Copy the invoice information under the Audit History page.
Once completed, re-create the invoice.
I'm adding these screenshots for additional reference.
For further guidance about creating invoices, you can check this article: Create an invoice.