Only transactions that are in a block on the blockchain are permanent (and really only for sure if there are a few blocks on top of the block the tx is in). So when you broadcast a transaction it does not go immediately into a block. It sits in what is called the mempool of bitcoin nodes that receive that broadcast. Only later when the transaction has been put into a block and the block has been broadcasted and accepted by the network does the transaction become fixed and typically after a few blocks have been made on top of that block do we consider it permanent and irreversible.