Typically diesel fuel is pumped under very high pressure to the fuel injectors and into your engine. When you run out of fuel and air gets into the fuel pump, it can't create enough force to move the fuel into your engine because the air compresses. You need to remove the air. This process is called "bleeding or purging the fuel lines." Once you do that, your generator should start up normally again.
Here is a video that shows you how to do this.