Allow me to clear some things up for you. The Undeposited Funds account holds your invoice and sales receipt payments, that you haven't deposited to a bank account yet. You can change the total amount in this account either by depositing your sales transaction payments into it. or depositing the amount from this account to a bank account.
Since you're trying to match it to your bank transactions, I suggest you deposit these funds to the appropriate bank account before you can proceed.
Go to the Banking menu.
Select Make Deposits.
All payments in the Undeposited Funds account will be listed on the Payments to Deposit window. Put a check on what you need to deposit.
Can not edit undeposited funds to match downloaded bank transaction Using Desktop 2020 Needed when invoice payment does not match bank deposit
You can edit the invoice payment before adding it to a deposit. The written amount is the legal amount of a check and overrides the numbers - but whatever the amount that cleared your bank would be the amount that cleared your customer's bank and so they either shorted you or paid too much. Thus the invoice is still open or there is a customer credit to use later.
Or the deposit total might just be wrong at the bank and in a day or two they will correct it. In this situation, you have choice of making the deposit match the bank and then make a new adjustment when that comes through.
Finally an option is the add the transactions from UF to a deposit and add an adjustment line to the deposit (only when you know for certain the payment amount is correct and that the check correctly cleared - this can happen especially with cash deposits where you swear you added right but somewhere between the store and the bank you dropped some coins along the way.