Rollback undoes changes made in the current transaction.
Rollback() is crucial for maintaining data integrity. If an error occurs during a transaction, rollback() can revert all changes, preventing partial updates. For example, if a payment fails during checkout, rollback() can undo any inventory adjustments already made.