The surge is the increase in rpm of a stalled compressor. The compressor blades are airfoils not unlike propellers and wings. They will stall if airflow is not maintained at the proper angle of attack.
Interruption of airflow in jets can be caused by abrupt maneuvering, ingestion of foreign matter, or excessive application of throttle. Much has been done to eliminate this issue in modern jets, but the nature of the design still makes it possible. If air flow is interrupted to the compressor, the jet can literally backfire, creating a loud "bang". A large yellow flame may also be seen coming from the back of the jet as the fuel/air mixture is now excessively rich due to insufficient air.
If the engine is not damaged, it can be re-started the same way we unstall a wing, by re-establishing proper airflow angle of attack. This is done by lowering pressure BEHIND the compressor. Throttle is reduced. Provided the engine is not damaged, throttle can be carefully restored.