The Layer to Image Size command resizes the layer boundaries to match the image boundaries, without moving the contents of the layer with respect to the image.
7.52.1. Activating the Command
You can access this command from the image menubar through
Layer → Layer to Image Size.