Orbiting around an object of variable mass

I'm curious - what would happen if a satellite was in orbit around an object which suddenly lost a large piece of its mass, or gained a large amount of mass? Of course this seems extremely unlikely to occur in nature, but I suppose similar reactions could be produced by using engines to counter the gravitational pull.

The problem with "what would happen if XXX ?" questions, where XXX violates physical laws, is that any answer is possible of course. You cannot use the system of laws of nature anymore to consider what would happen if something is defined from the start to violate them.

Now, in purely Newtonian gravity, there's no problem: just change the value of M, and take the last values of position and velocity as the new initial values of the new trajectory. The diminished pull (because the new value of M is smaller) can be indeed set equivalent to the effect of any other force in the opposite direction, yes.