Sounds to me like you're thinking of the story of Joseph from the Old Testament (y'know, Joseph and the coat of many colors, that Joseph?) There was a point in the story were Joseph's in jail, but through his actions enables a fellow cellmate in jail to go free, that cellmate promising to help Joseph get out of jail too, but forgot about Joseph for a number of years before repenting suddenly when circumstances enable Joseph to come to the forefront of his attention again.If you have a bible handy to check for yourself, the whole story of Joseph is covered in Genesis chpts 37-50, but the point of the story where this transpires is in chapter 40, and technically on into 41 as well.Hope that helps.