I’ll admit – I’ve done this once or twice. Each time causes me some grief while trying to get things set up correctly.
Here’s how to fix this issue as long as you have access to the Direct Console UI or ESXi Shell.
esxcli network ip route ipv4 remove -g w.x.y.z -n default
esxcli network ip route ipv4 add -g a.b.c.d -n default
This assumes that w.x.y.z is the old, incorrect gateway, that you might have set in the vSphere client, and a.b.c.d is the new gateway.