The "Fill Surface Layer (clear others)" button under the Terrain Tool tab on the workbench needs a confirmation button.
I've just accidentally wiped the whole terrain texture because I mis-clicked this button instead of "Change Layer's Material".
You can't undo this action once it's done.