What kinda vehicle ?
The high revs will clear up when the computer learns and stores the new parameters.
All those symptoms point to low voltage. The OBD engine computer (ECU/PCM) re-boots, and the idle settings are deleted, when you: (1) let the battery run down by leaving the lights or radio on, (2) disconnect the battery for an extended period of time, (3) when the battery goes bad and needs replacing, (4) when the alternator is not properly charging the battery, (5) or when poor battery connections result in a voltage drop at the PCM or poor battery charging. Loose, corroded, or damaged battery cables or ground wires may also cause or contribute to the problem.
A faulty Coolant Temperature Sensor may also cause similar symptoms. Testing of the CTS is recommended as part of the diagnostics. A poor ground at the ignition coil can also cause similar symptoms.
The reboot symptoms are: (1) having difficulties starting the engine without depressing the gas pedal, and (2) the engine will have a low idle and probably stall unless you keep your foot on the gas pedal. (3) The ECU will relearn the idle settings after a short period of driving and the engine will often start and idle normally.
Begin with basic trouble shooting of the start and charge systems. Remove, clean, and firmly reconnect all the wires and cables to the battery, starter, and alternator. Look for corroded or damaged cables or connectors and replace as needed. Copper wires should be copper color, not black or green. Do the same for the grounding wires from the starter to engine block, the PCM, the ground wires at the coil, and the ground wires at the oil dipstick tube. You must remove, wire brush, and clean until shiny, the cable/wire ends, and whatever they bolt to. Jeeps do not tolerate low voltage, bad connections, or poor grounds.
If the symptoms reoccur, you need to have your battery and/or the alternator Load Tested at a repair shop or auto parts store. This is usually a free service they offer to bring in potential customers. Handheld testers are very inaccurate and will usually pass marginal alternators. Even with low battery voltage, the engine will start, but the ECU can re-boot multiple times and a new battery may be required.
Cleaning the Idle Air Controller (IAC), regular tune-ups, and using fuel injector cleaner should be part of your routine preventative maintenance for smooth starts.