A toilet works by gravity: The water in the tank—just enough to fill
the bowl—drops down and pushes waste through the drain. The float drops, opening a valve that lets in water to refill the bowl and the tank simultaneously. The valve closes when the float rises far enough to shut off the water.
If the water from the tank can't leave the bowl fast enough, then the refill will spill over. To stop the refill action, take off the top of the tank, grab the float, and pull it up to close the valve. That should give you time to reach down and shut off the water, or at least wait for some of the water in the bowl to drain.
Get to know your toilet better with How to Fix a Leaky or Runny Toilet