On Oedipus's birth, his father King Laius of Thebes is warned that his son will grow up to slay him, so he is taken out of Thebes and left as a baby on Mount Cithaeron- and his ankles are pinned together (i.e. the name Odipus being derived from this meaning 'Swollen Feet'). However, as luck would have it, a shepherd discovers the baby and takes him home and eventually, he ends up being adopted by King Polybus of Corinth-- where he is brought up.
Ironicallly, when Oedipus grows up, he goes to the Oracle at Delphi too, where he is told that he will slay his father- so he resolves never to return to Corinth! Travelling away, he reaches Thebes, meets and kills his real father Laius, and ends up marrying his mother Jocasta and ruling Thebes.