Is there an unflatten command in Photoshop?
No. Layer > Flatten Image merges all visible layers into a single background layer and discards hidden ones. The only built-in ways back are Undo, the History panel and File > Revert, and they only work before the document is closed or saved over.









