Welcome to the Community. It's sad to know that the program automatically signed you out before saving the invoice. Unsaved invoice can't be retrieved, however, we can try checking the Audit Log activities involving that specific invoice. Here's how:
From the Gear icon, pick Audit Log.
Click the arrow down next to Filter.
Pick a User.
Set the Date.
Move the radio button to Show only these events, then mark the Transactions box.
If you're unable to find the invoice, I recommend adding it again and make sure to click the Save button. Check out this video tutorial for reference: How to create a customer invoice.