Wasn't there one episode where the Moon briefly finds itself back in Earth orbit to find that the entire planet has been laid waste (except for a small patch of land which still supported life)
Yes, that would be "Another Time, Another Place"
implicitly because of what happened when the Moon originally left orbit?
No, it's some sort of parallel dimension: "This is the Earth, but not the world we knew. It's an Earth where perhaps we never existed. Or perhaps we have yet to be born. But apart from us it's empty now. A civilisation once flourished here. Another Atlantis, perhaps. There are relics of them everywhere."