On top of the fuel pump sits a valve that holds the pressure in the fuel lines after turning the engine off.
When the fuel in the lines get warmer, they get gas bubbles and they will push petrol back into the tank. So you'll have to wait until the fuel gets colder and the gas bubbles disappear until you can start the engine again. So fit a new valve to your fuel pump!