Meaning: to succeed in recovering from a bad situation (see out of the woods)
Example: The team had been losing since the start of the game but in the last 1 seconds of the game they pulled it out and won the game.
See this Idiom in a story: Sports: Adam Plays Football