Once merged or flattened you can recover, as an undo (ctrl-Z), only for the session. Come back the next day and the image is fixed. Save as a Gimp .xcf to keep all layers and get in the habit of making incremental backups.
There are ways to mitigate this. Instead of merging use Layer -> New From Visible and use the new layer as a 'staging point' The un-merged layers below this layer. It all comes with use and practice.
Merging, does what it says. Either From the Image menu or in the Layers menu Merge Down which combines two layers. Flatten merges all layers and removes the alpha channel.
For the final image that you use, then export as a png which keeps any transparency (= merge) or export as a jpg which loses transparency (= flatten)