There's no direct way to change a transaction from an expense to a deposit, manager39. However, I know some workarounds that will help you achieve your goal.
Before anything else, may I know if this is a downloaded transaction or manually entered? Any additional information you can provide will help us give you an answer tailored to your needs.
If the transaction was downloaded as an expense transaction, you'll need to exclude it from the Bank Transactions tab, then manually record it as a deposit.