I lost 3 hours of work to Claude Code, so I built an undo button for AI-assisted coding
Dev.to AI
•
Generative AI
I lost 3 hours of work because Claude Code refactored my auth module into oblivion I was in the zone. Claude Code was crushing it - added OAuth, hooked up the database, wired the routes. Then I said: "refactor auth.ts to use middleware instead of inline checks." Fifteen files changed. TypeScript errors everywhere. The app wouldn't build. And I realized I hadn't committed in over an hour. git diff showed me 400 lines of changes across 15 files. I had no idea which version of auth.ts actually worked. I spent 3 hours manually reconstructing the last working state.