code: def rollback(self):
          
          if hasattr(self.local, 'tx') and self.local.tx:
              tx = self.local.tx.pop()
              tx.rollback()
              self._flush_tables()
docs: Roll back the current transaction.
  
          Discard all statements executed since the transaction was begun.