your gas-wire, connecting the pedal to the fuel injection, is probably broken.
idle control sencor
clogged catilytic converter
It could be the idle control P1507
it is because the engine is getting cold and it will automatically idle up to warm its self if this happens put it in park and press the gas to the floor for 2 seconds and release it will idle back down
Sounds like low idle which may be a vacuum leak, dirty TB (throttle body), or dirty IAC (idle air control) valve.
Idling is what your car is doing when it is just sitting somewhere running. As soon as you press on the gas it is no longer idling. Your idle speed is the number of RPMs your engine runs at when you are idling.
rough idle smell gas
Thermastat
Could be automatic choke stuck by bent spring or throtle linkage
Need to flush your fuel injector
you have a broken air intake hose the large plastic line going to the air filter
You might need to check the spark plug wires, fuel filter, and check the vacuum hoses.