def restore_object(self, request, *args, **kwargs):
        data = get_api_post_data(request)
        if 'id' not in data:
            raise ParseError('Missing id.')

        restore_id = data['id']
        if isinstance(restore_id, str) and restore_id.isdigit():
            restore_id = int(restore_id)

        if not isinstance(restore_id, int):
            raise ParseError('id needs to be an integer.')

        changeset = self.get_object()
        with changeset.lock_to_edit(request) as changeset:
            if not changeset.can_edit(request):
                raise PermissionDenied(_('You can not edit changes on this change set.'))

            try:
                changed_object = changeset.changed_objects_set.get(pk=restore_id)
            except Exception:
                raise NotFound('could not find object.')

            try:
                changed_object.restore()
            except PermissionError:
                raise PermissionDenied(_('You cannot restore this object, because it depends on '
                                         'a deleted object or it would violate a unique contraint.'))

            return Response({'success': True})