So, related obviously correct designs:<p>1. Git's Force-with-lease. Git push's "force" is too powerful, you will likely regret this much power, but it's tempting. So force-with-lease is the same power <i>but</i> conditional on you telling git what exactly the state was that you're overriding.<p>This has two benefits, one is like Rachel's, it is an opportunity for a human to stop for a moment and consider, wait, why are we overriding this state? To find out what it is we might as well read... oh the state says it's an "emergency fix. Call Jerry". Maybe, just maybe, I ought to call Jerry before I force overwrite it?<p>But the other is about race conditions which Rachel doesn't specifically address. If you are <i>very careful</i> to check that the state you want to overwrite with force is indeed a state that should be overridden, nothing prevents it meanwhile <i>changing</i> and then you overwrote state you didn't even know existed. But force-with-lease fixes that because your lease won't match.<p>I believe Force-with-lease is a pattern that ought to be far more widespread. I've used several configuration management tools that let somebody say "Temporarily don't mess with config on these machines" and <i>some</i> of them let you write a reason like "James is rebuilding the RAID arrays" but none of them have that force-with-lease pattern that would be let me say "I know James is rebuilding the RAID arrays, this change must happen anyway <i>but</i> if anything else is blocking the change then reject it and let me know".<p>2. Prefer Undo to Confirmation. If the computer <i>can</i> undo the action, even if that's a bunch of work and you'd rather not bother, put that work in and enable undo. Humans always know they "really" wanted to do the thing you're asking them to confirm so it's somewhat futile to ask, but they often realise they didn't want to afterwards and will undo it <i>if</i> you make that possible.<p>Not everything can be undone. Undo factory reset isn't a thing. But <i>lots</i> of things you can't undo it was just laziness, try to do better in your own software. Your users (which might include you) will be grateful.