Answer: Clinging to Polyphemus' sheep, they are able to escape when the now blind cyclops lets them out of the cave.
Explanation: Hear me, Poseidon, earth-enfolder, thou dark-haired god, if indeed I am thy son and thou declarest thyself my father; grant that Odysseus, the sacker of cities, may never reach his home, even the son of Laertes, whose home is in Ithaca; but if it is his fate to see his friends and to reach his well-built house and his native land, late may he come and in evil case, after losing all his comrades, in a ship that is another's; and may he find woes in his house.
Hope this helped! :)