Purge

4th-level Abjuration
Casting Time: 1 action
Range: 120 feet
Components: VS
Duration: Instantaneous

Choose one creature, object, or magical effect within range. If the target is a creature, you may then choose a single spell affecting that creature. If the spell is 3rd level or lower, it ends. If the spell is of 4th level or higher, make an ability check using your spellcasting ability. The DC equals 10 + the spell's level. On a successful check, the spell ends.
If a creature is targeted by this spell, the disruption of magical energy this spell produces disrupts their locomotion. A creature must make a Constitution saving throw or have their movement speed halved until the end of their next turn.
Finally, this spell is especially effective on creatures not native to your plane of existence, or creatures created by magic. If this spell targets a creature, and that creature was created by a spell (such as a raised skeleton) or is not native to this plane of existence (such as an elemental or demon), the creature must make a Charisma saving throw or be banished to their home plane (if they are not native to this plane) or destroyed. On a success, the target takes 5d6 lightning damage.
At Higher Levels. When you cast this spell using a spell slot of 5th level or higher, you automatically end the effects of a spell on the target if the spell's level is less than the level of the spell slot you used. Additionally, the damage of this spell on successful saves by summoned and extraplanar creatuers increases by 1d6 for each slot level above 4th.

Source: Homebrew