SQL reads back over the transaction log entries for the transaction that needs to be rolled back and generates compensating operations (operations that reverse the effect of each logged change) which it then logs and executes.