It is just to make your variables invert the sign, but it will depend a lot on your code, for example, if you do vsp += 1, then now it will be vsp -= 1. You can add a multiplier at the end, for example, the variable is initially 1, so anything multiplied by 1 will be itself. Now if you activate "inverse gravity", you set this multiplier variable to -1 and this will reverse the direction of gravity.