Save one's bacon
Escape from injury; avoid harm, especially to one's body.
By bacon, we now normally mean the cured and dried meat taken from the back or sides of a pig. To the medieval mind, 'bacon' was meat from anywhere on the body of the animal - more akin to what we now call pork. This was the origin of the slang term 'bacon' meaning the human body. 'Saving your bacon' was simply saving your body from harm. The expression was used that way as early as the 17th century as, for example, this extract from Ireland's Momus Elenticus, 1654:
"Some fellowes there were... To save their bacon penn'd many a smooth song."