How to Unflatten an Image in Photoshop
Photoshop Tutorial · Layers & Recovery

How to Unflatten an Image
in Photoshop

The honest guide — undo, History panel, Smart Object extraction, AI-assisted layer reconstruction, and the hard truth about what's actually recoverable after saving.

By: Titto S. Updated: October 2026 Skill level: Beginner to Intermediate Works in: Photoshop 21 and Newer Versions
Quick Answer

To unflatten an image in Photoshop, press Ctrl + Z (Cmd + Z on Mac) right after flattening, or open Window → History and click the state just above "Flatten Image". Both only work while the document is still open in the same session. If your layers were put into a Smart Object instead, double-click it to get them back. If the file was saved and closed flat, the original layers are gone, and your only option is rebuilding new layers from the flat pixels.

The 30-Second Decision
  • Still open, just flattened — Ctrl/⌘ + Z
  • Still open, edited since — Window → History → click the state above Flatten Image
  • Layer thumbnail has a small page icon — it's a Smart Object; double-click to open it
  • Saved and closed flat — rebuild with Select → Subject and Ctrl/⌘ + J
  • Got your layers back? Save as a PSD straight away
Read This First

The Honest Answer

"How do I unflatten my image in Photoshop?" is actually four different questions. What decides it is whether the file has been saved and closed since it was flattened.

If the document is still open in the same session, your layers are usually recoverable in seconds. If you saved, closed and reopened a flat file, the original layer data is gone, and no plugin or AI tool can bring it back. What you can do is rebuild new layers from the flat pixels, which is useful but not the same thing.

This guide covers all four scenarios, starting with the quickest fixes.

The hard truth

If you saved a JPEG, PNG or flat PSD and closed it, the layers were merged when the file was saved, so they can't be separated again. Anything that claims to "unflatten" it is really rebuilding layers from the flat image, which is Method 4 below.

Start Here

Which Situation Are You In?

Whether you can recover layers in each situation
SituationCan you get the layers back?Use
Just flattened, file still openYesMethod 1: Undo
Edited since flattening, file still openYes, if the Flatten Image step is still in the historyMethod 2: History panel
Layers were merged into a Smart ObjectYesMethod 3: Smart Object
Saved and closed as JPEG, PNG or flat PSDNo. You can only rebuild new layers.Method 4: Rebuild
Method 1 of 4

Undo: The Fastest Fix

If flattening was one of the last things you did in this session, undo gets your layers back exactly as they were.

1
Press Ctrl + Z (Windows) or Cmd + Z (Mac)

The Layers panel repopulates with every layer. If you've done other things since, keep pressing it, or use Edit → Step Backward (Ctrl + Alt + Z on Windows, ⌘ + Option + Z on Mac).

2
Check the Layers panel

Make sure all your layers are back before you do anything else.

3
Save as a PSD immediately

Go to File → Save As → Photoshop (.PSD). This keeps your layers safe if Photoshop closes.

History limit

Photoshop keeps 50 history states by default. If you've made more than that since flattening, the flatten step may have been pushed out. You can raise the limit in Edit → Preferences → Performance (on a Mac, Photoshop → Settings → Performance) so it doesn't happen next time.

Method 2 of 4

History Panel: Jump Back to Any State

This method is recommended when you've made more changes since flattening and Undo won't get you back far enough. The History panel lets you jump to any recorded state in the current session.

1
Open the History panel

Go to Window → History. It lists every action in this session, oldest at the top.

2
Find "Flatten Image"

Scroll until you see the entry labelled Flatten Image. That's the moment your layers were merged.

3
Click the state just above it

Your layers reappear exactly as they were. Anything you did after flattening is removed when you go back, so think about whether that work matters.

4
Save as a PSD

Go to File → Save As → Photoshop (.PSD) straight away.

Keep the work you did since

If you want to compare the layered and flattened versions without losing either, open the History panel menu, choose History Options and turn on Allow Non-Linear History. Going back to an earlier state then no longer deletes the later ones.

Remember that history only exists while the document stays open. Once you close it, the history is gone.

Unflatten An Image In Photoshop using History Panel: Jump Back to Any State
Window → History.
Method 3 of 4

Extract Layers from a Smart Object

A Smart Object is different from a flatten image. When you convert layers into a Smart Object, Photoshop embeds the original layers inside it, so you can still open it and get them back. You can spot one by the small page icon in the corner of the layer thumbnail. Adobe's guide to embedded Smart Objects explains how they work.

1
Double-click the Smart Object's thumbnail

In the Layers panel, double-click the thumbnail, not the layer name. Its contents open in a separate document, usually with a .psb extension.

2
Select all the layers inside

Click the top layer, then Shift-click the bottom one.

3
Duplicate them into your original document

Open the Layers panel menu and choose Duplicate Layers…. In the dialog, set the destination to your original document and click OK.

4
Tidy up and save

Switch back to your original document and confirm the layers are there. Close the Smart Object window without saving, delete the Smart Object layer, and save as a PSD.

Next time

If you want to group layers without losing them, use Convert to Smart Object (right-click the layers) instead of flattening.

Method 4 of 4

Rebuild Layers from a Saved Flat File

If the file was saved and closed as a JPEG, PNG or flat PSD, you can't get the original layers back. What you can do is build new, separate layers from the flat pixels. How well it works depends on the image and how cleanly you need the pieces separated. If you're after a generic graphic like an icon or a background, it may be quicker to find a fresh layered file than to rebuild one.

1
Open the file and unlock the layer

The image opens as a locked Background layer. Double-click it to unlock it, then press Ctrl/⌘ + J to duplicate it as a backup.

2
Select the subject

Go to Select → Subject and Photoshop selects the main subject for you. In newer versions you can also use Remove Background from the Contextual Task Bar or the Properties panel.

3
Refine the edge

With the selection active, go to Select → Select and Mask. Use the Refine Edge Brush on hair or other fine edges, and set the output to New Layer with Layer Mask so you can adjust it later.

4
Copy each element to its own layer

With a selection active, press Ctrl/⌘ + J to copy it to a new layer. Give it a clear name, then repeat for each element you need to separate.

5
Fill the gap behind it

Ctrl/⌘-click the new layer's thumbnail to load its selection, grow it a few pixels with Select → Modify → Expand, then on the original layer go to Edit → Fill → Content-Aware. For tricky backgrounds, the Content-Aware Fill workspace gives you more control.

This is rebuilding, not recovery

The result is a new set of layers made from pixels, not your original layers. Text becomes an image rather than editable text, layer effects are baked in, and gradients become pixel approximations. For client work, say clearly that you're rebuilding, and check whether that's good enough or whether you need the layered file from them.

AI-Powered Tools

Photoshop AI Tools That Help Most

Recent versions of Photoshop include several AI-assisted features that make rebuilding layers from a flat image faster and more accurate. These don't restore original layer data, but they cut down the manual work of building new layers from a JPEG or PNG.

🤖

Remove Background

One-click AI subject isolation. Cuts a layer to the subject with a transparent background in seconds. Best on subjects with clear contrast from background.

Photoshop 2024+
✨

Generative Fill

AI-powered fill using Adobe Firefly. Leave the prompt empty for natural background reconstruction after removing a subject — often more convincing than Content-Aware Fill on complex scenes.

Requires Creative Cloud
🎯

Select Subject

AI-powered one-click selection of the main subject. Works on people, animals, products, and objects. Combine with Select and Mask for clean edges on complex scenes.

All recent CC versions
🔍

Match Font

Identifies fonts in a flattened image (Type → Match Font). Draw a selection around the text, and Photoshop returns matching fonts from your system and Adobe Fonts.

Photoshop CC 2019+
📐

Select and Mask

Workspace for refining complex selections — hair, fur, fine detail. The Refine Edge Brush detects and separates fine edge detail that manual selection tools miss entirely.

All recent CC versions
🖌️

Neural Filters

For colour matching, Smart Portrait adjustments, or style transfer on reconstructed layers. Useful for matching skin tones when recompositing portrait elements.

Requires Creative Cloud
Bonus

Identifying Fonts in a Flat Image

Text is the hardest thing to rebuild from a flat image, because it's just pixels. Match Font can identify the typeface so you can retype it as a live text layer.

1
Select the text

Use the Rectangular Marquee Tool (M) to draw a tight selection around one line of text. Clear, high-resolution text gives the best results.

2
Run Match Font

Go to Type → Match Font. Photoshop suggests similar fonts from your system and Adobe Fonts. Pick the closest one.

3
Retype the text

Use the Type Tool (T) to type it again. Match size, tracking and leading in Window → Type → Character, and sample the colour with the Eyedropper (I).

If Match Font can't find it, an online font identifier that accepts a screenshot is a reasonable next step.

Identifying Fonts in a Flat Image
Type → Match Font for Identifying Fonts in a Flat Image.
Prevention

How to Prevent This Next Time

Every scenario above is avoidable with a few saving habits. Always keep a layered PSD as your master file, and treat flat exports as copies.

Habits that protect your layers in Photoshop
HabitWhy it works
Save a layered PSD before flatteningYou always have the original to go back to.
Export JPEG or PNG with File → Export → Export AsIt makes a flat copy without touching your layered document.
Convert to Smart Object instead of flatteningThe layers stay embedded and can be extracted later.
Raise History StatesA deeper undo buffer gives you more room within a session.
Don't overwrite your PSD with a flat versionSaving over it replaces the layers permanently.
The golden rule

Keep your layered PSD and export flat copies from it. File → Export → Export As (Shift + Ctrl/⌘ + Alt + W) makes a flat file without changing the source document.

Common Questions

FAQ

Does Photoshop have an unflatten command?

No. There's a Flatten Image command but no reverse. The only built-in ways back are Undo and the History panel, and both only work while the document is still open in the same session.

Can a plugin or other software unflatten a saved JPEG?

No. Once layers are merged and the file is saved flat, the layer data is gone. Tools that claim to do it are creating new layers from the flat pixels, which is the same rebuilding described in Method 4.

What if a client sent me a flat PSD?

A flat PSD can't be unflattened either. Ask the client for the layered original, or rebuild the elements you need to edit using Method 4.

My History panel doesn't show "Flatten Image"

The flatten step has probably been pushed out of the history. If the file went into a Smart Object, try Method 3. Otherwise your option is Method 4.

How do I increase the number of history states?

Go to Edit → Preferences → Performance (on a Mac, Photoshop → Settings → Performance) and raise History States from the default of 50. A higher number uses more memory, so lower it again if Photoshop slows down.

How to Unflatten an Image in Photoshop - Final Recap

If the file is still open, try Ctrl/⌘ + Z or the History panel. If your layers are in a Smart Object, open it and duplicate them out. If the file was saved flat and closed, rebuild new layers from the pixels. Next time, keep a layered PSD and export flat copies.

Works in Photoshop 21 and newer versions. Menu names and locations may differ slightly.