If you flattened your file by mistake, don't panic. Select "Undo" from the Edit menu or use keyboard shortcut Ctrl/Cmd + Z keys until your history panel goes back before your flattened point.