When undoing a change such as painting a layer, it will always reset every layer to their default visibility. That is, background layers to be visible and collision layers to be invisible, and so on. This is frustrating when trying to make a map and you need to have layers hidden to have a better idea on what you're doing.