undo.sh — bash — 80x24
 _   _ _   _ ____   ___   ____  _   _
| | | | \ | |  _ \ / _ \ / ___|| | | |
| | | |  \| | | | | | | |\___ \| |_| |
| |_| | |\  | |_| | |_| | ___) |  _  |
 \___/|_| \_|____/ \___(_)____/|_| |_|

# A shell script for reversing what cannot be reversed

# v1.0.0 | MIT License | use at your own risk

 

$ chmod +x undo.sh && ./undo.sh

undo.sh v1.0.0 -- starting...

Loading regret modules... done

Scanning decision history... done

Initializing: [░░░░░░░░░░░░░░░░░░░░] 0%

 

$ undo.sh --list-undoable

# First, we take stock. What can be undone?

# Not everything, it turns out. Some things are immutable.

 

Scanning for undoable items...

 

undoable/
├── decisions/
│   ├── the_job_you_took_for_money.log
│   ├── the_move_you_made_for_love.log
│   └── the_silence_when_words_were_needed.log
├── words/
│   ├── the_thing_you_said_in_anger.txt
│   ├── the_lie_that_was_easier.txt
│   └── the_truth_you_swallowed.txt
├── actions/
│   ├── the_door_you_slammed.sh
│   ├── the_message_left_on_read.sh
│   └── the_shortcut_you_took.sh
└── omissions/
    ├── the_call_you_never_made.bak
    ├── the_hand_you_didnt_reach_for.bak
    └── the_chance_you_let_expire.bak

 

12 items found. 9 undoable. 3 permission denied.

 

┌─────────────────────────────────────────┐
│  NOTE: Some things resist undoing.       │
│  Time passed cannot be recovered.       │
│  But its direction can be changed.      │
└─────────────────────────────────────────┘

 

$ undo.sh --dry-run

# Let's see what changes before we commit.

# Every undo is a diff between who you were and who you choose to be.

 

@@ decisions/the_silence_when_words_were_needed.log @@
- Sat quietly while they cried
- Assumed they wanted space
- Went home feeling hollow
+ Sat down beside them
+ Said: "I don't know what to say, but I'm here"
+ Stayed until the silence felt like enough

 

# The diff is small. Three lines changed.

# But three lines can rewrite an entire chapter.

 

@@ words/the_thing_you_said_in_anger.txt @@
- "You always do this. You never change."
+ "I'm frustrated, and I don't know how to say it without hurting you."
+ "Can we try again tomorrow?"

 

@@ actions/the_shortcut_you_took.sh @@
- took_the_easy_path --skip-learning
- arrived_faster --quality=low
+ took_the_long_way --with-curiosity
+ arrived_later --quality=high --growth=true

 

# A dry run costs nothing.

# The real courage is in --execute.

 

$ undo.sh --execute --confirm

WARNING: This operation cannot be undone. Proceed? [y/N]

y

 

Reverting decisions/the_job_you_took_for_money.log... done

Reverting decisions/the_silence_when_words_were_needed.log... done

Reverting words/the_thing_you_said_in_anger.txt... done

Reverting words/the_lie_that_was_easier.txt... done

Restoring words/the_truth_you_swallowed.txt... done

Reverting actions/the_door_you_slammed.sh... done

Restoring actions/the_message_left_on_read.sh... done

Reverting actions/the_shortcut_you_took.sh... done

Reverting decisions/the_move_you_made_for_love.log... done

ERROR: cannot undo omissions/the_call_you_never_made.bak (permission denied)

ERROR: cannot undo omissions/the_hand_you_didnt_reach_for.bak (time_expired)

ERROR: cannot undo omissions/the_chance_you_let_expire.bak (resource not found)

 

Progress: [░░░░░░░░░░░░░░░░░░░░] 0%

 

$ undo.sh --status

 

┌──────────────────────────────────────────────────┐
│  UNDO.SH EXECUTION SUMMARY                       │
├──────────────────────────────────────────────────┤
│  Total items:      12                            │
│  Undone:            9                             │
│  Failed:            3                             │
│  Time elapsed:     a lifetime                    │
├──────────────────────────────────────────────────┤
│  Status: PARTIAL SUCCESS                          │
│  Not everything can be undone.                   │
│  But enough was. And that matters.               │
└──────────────────────────────────────────────────┘

 

# In the end, undo.sh teaches you what forward means.

# You cannot revert the river.

# But you can choose which bank to stand on.

 

$

exit 0