If you're using the physics behavior you can't actually change the angle of gravity, but you can replace gravity altogether. If you wouldn't mind it, you can actually change gravity to either an impulse or force acting upon the object and use a variable as it's angle. So whenever the player triggers the switch, the impulse/force angle will adjust according to that.
You can then change the angle of the sprite to the variable you used for the angle of physics.