private function rollbackToRevision(Revision $revision) {
        if ($revision == null) {
            return null;
        }

        $current = $revision->revisioned;

        // delete the old revisions for this model if needed
        if($this->getConfigRollbackCleanup()) {
            $revisionsToDelete = $current->revisions()->where('id', '>=', $revision->id)->delete();
        }

        $current->fill($revision->old);
        $current->save();

        // reload the relations
        $current = $current->load('revisions');

        return $current;
    }