98 Cherokee rolls to ditch then will not start

My friend’s 98 Jeep Cherokee rolled back into a ditch and sat at about a 45 degree angle for about an hour while Jim got someone to pull it out. It started and ran for a few seconds after that, then puttered to a stop and now will not start. the starter sounds normal but the engine will not turn over. underneath there was a loose wire–a connecter with four short wires comming out, two white, one gray and one black. When we try to start it, now of the gages work, but everything else electric seems to be okay. Starting it sounds like its out of gas, and it was low when it went in the ditch. So we put a gallon in, but it still will not start.

Spray starting fluid in intake as close as you can to motor,if it starts you will know it is not a spark problem.
Turn key on and off 2-3 times while someone listens at the back, you should hear fuel pump. If you hear it look at fuel filters.