To make Polyphemus unwary, Odysseus gave him a barrel of very strong, unwatered wine. When Polyphemus asked for Odysseus' name, he told him that it was "Nobody". Once the giant fell asleep, Odysseus and his men took a hardened spear and destroyed his eye. In the morning, Odysseus tied his men and himself to the undersides of Polyphemus' sheep?. When he let the sheep out to graze, the men were carried out. Since Polyphemus was blind, he didn't see the men, but felt the tops of his sheep to make sure the men weren't riding them.
Once the sheep (and men) were safely out, Polyphemus realized that the men weren't in his cave. He yelled out to his fellow Cyclopes that "Nobody" hurt him, so they ignored him. As Odysseus and his men were sailing away, he told Polyphemus that "Nobody didn't hurt you, Odysseus did!" Odysseus didn't realize that Polyphemus was the son of Poseidon, and that telling him his name would have severe repercussions.