5 confirmations, then you can undo the transaction?
I think that's impossible. I don't think there's any wallet that can do this except for transactions with 0 confirmation. Electrum can cancel the transaction, but the process is by replacing the old transaction to send BTC back to your wallet with a higher TX fee.