def revert(self, backend=None):
        """
        Reverts the state of the document to that contained in the database. 
        If the `backend` argument is not specified, the function resorts to the *default backend* 
        as defined during object instantiation. If no such backend is defined, an `AttributeError` 
        exception will be thrown.

        :param backend: the backend from which to delete the document.

        .. admonition:: Keep in Mind

            This function will call the `initialize` function after loading the object, which
            allows you to perform document-specific initialization tasks if needed.

        """
        self._lazy = False
        logger.debug("Reverting to database state (%s, %s)" % (self.__class__.__name__, str(self.pk)))
        if self._db_loader:
            obj = self._db_loader()
        else:
            backend = backend or self._backend
            if not backend:
                raise AttributeError("No backend given!")
            if self.pk == None:
                raise self.DoesNotExist("No primary key given!")
            obj = backend.get(self.__class__, {self.get_pk_name(): self.pk})
        self._attributes = obj.attributes
        self.initialize()
dataset/ETHPy150Open adewes/blitzdb/blitzdb/document.py/Document.revert/original