winner-mode permet ça, et ça marche bien pour moi dans des cas comme
celui que tu décris.
| `M-x winner-mode' is a global minor mode that records the changes in
| the window configuration (i.e. how the frames are partitioned into
| windows), so that you can "undo" them. To undo, use `C-c left'
| (`winner-undo'). If you change your mind while undoing, you can redo
| the changes you had undone using `C-c right' (`M-x winner-redo').
| Another way to enable Winner mode is by customizing the variable
| `winner-mode'.
-- Alain.