Can a Smart Contract Execution Be Reversed after Consensus Is Reached?

No, a smart contract execution, once included in a confirmed block and consensus is reached, is final and cannot be reversed. This is due to the immutable nature of the blockchain.

If an error is made or an unintended action occurs, the only way to "fix" it is to create a new transaction that reverses the state change, assuming the contract's code allows for such an action. For example, to reverse a payment, a new payment of the same amount would have to be sent in the opposite direction.

The original transaction, however, will always remain in the blockchain's history.

How Does the Concept of ‘Finality’ Relate to Blockchain Security and the Risk of a 51% Attack?
What Is the Concept of ‘Immutability’ in Blockchain Technology?
Define “Transaction Finality” in Blockchain Systems
What Is the “Longest Chain Rule” and How Does It Relate to Block Confirmation?
What Is ‘Finality’ in the Context of a Blockchain Consensus Mechanism?
How Does a Transaction with a Zero Fee Get Confirmed in a Low-Traffic Blockchain?
What Is the ‘Finality’ Concept in Blockchain Consensus Mechanisms?
What Is ‘Finality’ in a Blockchain Context like Ethereum?

Glossar