Out of the woods

No longer in a dangerous situation or condition.

The man’s injury is very serious and he is not out of the woods yet.