# Error Prevention and Undo

> How to make mistakes hard to make and easy to take back. Error prevention, the undo button, and the dark patterns that trick people on purpose.

**Course:** [UX Design and Research](https://learn.benibix.com/learn/design-user-experience)  
**Time:** 10 min

**After this lesson you can:**

- Prevent an error before it happens
- Offer undo instead of a warning
- Spot a dark pattern

## How to make mistakes hard to make

Error prevention means making mistakes hard to make, so there is less to fix later. A date picker for a return flight can fade out each day before the first flight. Nobody can pick those days, so nobody books a return before they leave. One faded row stops a whole kind of mistake.

Prevention comes in many forms. Limit choices to the ones that are valid. Fill in what you already know. Check a field as soon as it is typed, not after the whole form is sent. Ask for a password twice only if you cannot offer a show button.

When a mistake gets through, undo takes it back. Delete a message, and a bar appears with an undo link for a few seconds. Many email services let you undo a sent message for up to 30 seconds. A slip is never final.

Undo beats a warning box. Are you sure? pops up so often that people click yes without reading. Undo lets them act at full speed and fix the rare mistake after. Save the warning for actions that truly cannot be undone, like closing an account.

A dark pattern is the opposite of all this. It is a trick in a design that pushes you to do something you did not mean to. A box already ticked to sign you up for emails. A cancel button hidden three menus deep. A countdown timer that resets when you reload.

The name was coined in 2010 by a UX designer who collected examples. Many dark patterns are now against consumer law in parts of the world, such as the EU. Even where they are legal, they trade a sale today for trust tomorrow.

The common mistake is to blame the user for errors. If many people make the same mistake, the design invited it. Fix the design, not the people. A support log full of the same error is a design brief.

![Two panels. On the left, a row of dates for a return flight, where the days before the 13th are faded with dashed borders and cannot be picked. On the right, a crossed-out message and a dark bar at the bottom that says Message deleted, with an Undo link and an arrow back up to the message.](https://learn.benibix.com/diagrams/des3-error-undo.svg)

### Example: A photo app drops its warning box

A photo app asked are you sure? every time someone deleted a picture. Users still lost photos, because they clicked yes by habit.

The team removed the box and kept deleted photos for 30 days in a bin. Complaints about lost photos fell to almost none.

**Words in this lesson:** [Error Prevention](https://learn.benibix.com/term/design/error-prevention), [Undo](https://learn.benibix.com/term/design/undo), [Dark Pattern](https://learn.benibix.com/term/design/dark-pattern)

**Question:** Why is undo often better than an are you sure? box?

**Answer:** People click yes by habit, but undo lets them fix the real slip. A box that appears every time trains people to click yes without reading. Undo lets them work at full speed and fix the rare mistake afterwards.

---

Source: https://learn.benibix.com/learn/design-user-experience/error-prevention-and-undo
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
