What probably happened is that the nose was raised too high, leading to a full-power stall. This is something that's not covered in the PPL syllabus (only power-off stalls are normally taught) but they're a non-event and can indeed be corrected with only minimal height loss, or even no height loss at all. After all, with the ridiculously high fuselage angle that's required for a full-power stall, the engine thrust has a very significant vertical component.
The biggest danger in such a situation is not so much hitting the ground but hitting the trees at the far end - your climb rate is effectively reduced to zero.