If you accidentally flush the toilet and it starts to overflow, don't panic. Quickly reach behind the toilet and turn off the water supply valve located near the base of the toilet. This will stop the flow of water into the toilet bowl and prevent further overflow. Once the water has stopped, you can proceed with unclogging the toilet using one of the methods mentioned earlier.