Exit doesnt work in the optional dungeons, I dont think.

Next time you get lost in the desert, follow the palm trees. They're shaped like triangles (technically) and the tip points the direction you need to go.

The dungeons are random, so you need to wander around until you find stairs or, like WarZidane said, lose a battle.