There's a way to keep an invoice and its deposit on your records. I'll be happy to give you options.
When you pay (Receive Payment) an invoice and deposit that payment, both transactions will stay in your records.
If you're matching a downloaded deposit from the Banking page, you won't want to match it to an invoice yet. Instead, you'll want to record an invoice payment and deposit that payment first. Then, match the deposit from Banking to the deposit in QuickBooks.
You can comment below if you need to your sales transactions and deposits.