3D printer: How to home only Y axis using G-Code?

To home only the Y axis on 3D printers running on most firmwares, use G28 with the Y axis specifier

G28 Y