code: def rollback(self):
      
      try:
        if self._cur_batch:
          self._cur_batch.rollback()
      except ValueError:
        # ignore "Batch must be in progress to rollback" error
        pass
      self._cur_batch = None
      self._num_mutations = 0
docs: Rolls back pending mutations.
  
      Keep in mind that NoTransactionBatch splits all mutations into smaller
      batches and commit them as soon as mutation buffer reaches maximum length.
      That's why rollback method will only roll back pending mutations from the
      buffer, but won't be able to rollback already committed mutations.