As has been said, it's technically the party that get voted in, not the PM.
However, those votes will have been done on the manifesto provided at the GE, so if a new PM is to take over it should be that they have to retain that manifesto for the remainder of that term.
That was the big issue...