Gravitational potential energy of an object will:
not be effected by changing the path, provided the overall height is same
The gravitational potential energy is path independent and is not affected by the path followed provided the overall height is same.