Get out of the woods

Meaning: To escape from a difficult or dangerous situation.

Example: The company has reduced its debts, but it is not completely out of the woods yet.