It’s totally another meaning but it’s funny.
this idiom is used when someone fails and is in deep desperation.
if it’s said by the same party, it indicates the temporary retreat is not shameful and he/she will return some day in the future
If it’s said by another party, it’s to prevent someone doing stupid things like ending its life.
word by word it means:
as long as there is a mountain (keep some important resources, usually it points to the people)
there would always be wood. ( you would survive and restore from the disaster)
So some translations are:
live to fight another day.
where there is life, there is hope.