def revert(self, revision_id):
if self.model is None:<EOL><INDENT>raise MissingModelError()<EOL><DEDENT>revision = self.revisions[revision_id]<EOL>with db.session.begin_nested():<EOL><INDENT>before_record_revert.send(<EOL>current_app._get_current_object(),<EOL>record=self<EOL>)<EOL>self.model.json = dict(revision)<EOL>db.session.merge(self.model)<EOL><DEDENT>after_record_revert.send(<EOL>current_app._get_current_object(),<EOL>record=self<EOL>)<EOL>return self.__class__(self.model.json, model=self.model)<EOL>
Revert the record to a specific revision.

        #. Send a signal :data:`invenio_records.signals.before_record_revert`
           with the current record as parameter.

        #. Revert the record to the revision id passed as parameter.

        #. Send a signal :data:`invenio_records.signals.after_record_revert`
           with the reverted record as parameter.

        :param revision_id: Specify the record revision id
        :returns: The :class:`Record` instance corresponding to the revision id