Move along path

I am making a sidescroller but isntead of having flat ground, the terrain is hilly. my question is how would i make it so the char will only go along a set path and will kind of rotate him when he starts walking up or down a hill? any tutorials that teach somethign similar to this woudl help, thanks.