Limited wish

Limited wish is a universal spell that alters reality, within limits.

Effect
With the restriction that the effects listed must be of decreasing power than the one listed before it, the possible effects the caster can create with a limited wish spell are to: duplicate a moderately-powerful sorcerer or wizard spell, provided they have experience casting spells from that school of magic; duplicate any non-sorcerer or -wizard spell, with the same restriction; duplicate any sorcerer or wizard spell from any school of magic; or duplicate the effects of any type of spell. If the spell duplicated requires a material component, the caster must provide that component.

Limited wish can also be used to undo the harmful effects of many other spells, such as geas/quest or insanity.