Inversion (5e Spell)

From D&D Wiki

When you cast this spell on yourself, you focus and reverse one non-instantaneous spell effect currently being cast on you when you finish casting. Damaging spells are ended, while spells with non-damaging effects return to their caster and effect them. If the effect would stop them from casting spells, the spell effect also ends without doing anything. The caster becomes aware of this change, and if they have control over the spell they can end it on their turn as normal, but can't put it back on their original target unless that spell explicitly says it can. The caster doesn't have to be a creature, so this spell can work for potions, items, locations (But not planar effects), and traps as well, though only those that could reasonably affect the original caster and aren't themselves instantaneous (You can use it on periodically occurring effects, such as those that happen when you spend an amount of time in a location). This spell cannot invert spell effects cast at a higher level than it, but if you cast it at higher level, you can potentially affect those spells.

At Higher Levels. When you cast this spell using a spell slot of level 2, you can affect one additional creature within 30 feet of you as if they cast the spell on themselves (Spells that affect a location can be inverted throughout that location, not simply within 30 feet of the caster). When you cast this spell using a spell slot of 3 or higher, you can affect twice the amount of additional creatures as with the next lower level of the spell.