Can you revert/cancel a transaction?

In general - no. Once confirmed, transaction is recorded irreversibly on the blockchain (6+ confirmations is considered irrevocable) as other block has been mined on top of the one that includes the transaction (and all blocks are built on top of each other - like a jenga tower, if you’d remove one piece/block, the chain would recognize it).

Unconfirmed transaction - in theory it does not have to be mined and hence can be changed. If you need to speed up the transaction, it is possible to you the Replace by fee feature. Read more about it here: RBF.