They do a blood patch. A little amount of blood is taken from the patient and the anesthesiologist injects the blood at the site of the original puncture. A blood clot is established and it stops the leaking of cerebrospinal fluid. Loss of CSF causes the headache and when the puncture site is patched CSF stops leaking and the headache goes away.