Just to get you started, to do these things with a RigidBody it's possible to override the current integration, and create your own. For your example of reversing gravity, this is a simplified example of what you can do.
var dt = state.get_step()
var gravity = state.get_total_gravity() # The default gravity, you can use your own.
var velocity = state.get_linear_velocity()
state.set_linear_velocity((velocity + gravity * -1) * dt)
If you also interested in choosing the gravity's direction, you can use a unit vector as a direction and multiply it into the magnitude of gravity.
var direction = some_normal_vector * gravity.length()
state.set_linear_velocity(velocity + direction * dt)