If you chose two targets, Invert switches the power and toughness of one creature and it switches the power and toughness of another creature. It doesn’t switch one creature’s power with another creature’s power.
Effects that switch a creature’s power and toughness apply after all other effects, regardless of when those effects began to apply. For instance, if you cast Invert targeting a 1/2 creature then give it +2/+0 later in the turn, it’s a 2/3 creature, not a 4/1 creature.
Converted Mana Cost
Search your library for an instant card and/or a sorcery card, reveal them, put them into your hand, then shuffle your library.