_ _ _ __ _ __| | ___ ___| |__
| | | | '_ \| '__| |/ _ \ / __| '_ \
| |_| | | | | | | | (_) |_\__ \ | | |
\__,_|_| |_|_| |_|\___/(_)___/_| |_|
══════════════════════════════════════════════════════════════════
[ GIT ] — undo for version control
$
git
reset
--soft
HEAD~1
$
git
reset
--hard
origin/main
⚠
DESTRUCTIVE — uncommitted work is lost. There is no "trash".
$
git
revert
<sha>
$
git
restore
path/to/file.txt
$
git
fsck
--no-reflog
|
awk
'/dangling commit/ {print $3}'
$
git
reflog
|
grep
'feature-x'
══════════════════════════════════════════════════════════════════
[ FILES ] — undo for the filesystem
$
extundelete
/dev/sdaX
--restore-file
path/to/file
⚠
Stop writing to the disk NOW. Unmount and clone before recovery.
$
mv
new/location
original/location
$
ls
-la
*~
$
touch
-d
'2026-04-30 12:00'
file.txt
[ PERMISSIONS ] — undo for chmod / chown
$
sudo
dpkg
--verify
|
awk
'/^.M/'
⚠
Reinstall affected packages: apt --reinstall install <pkg>
$
find
/path
-newer
/tmp/marker
-exec
chown
orig:orig
{}
+
$
umask
022
[ NETWORK ] — undo for routing & firewall
$
sudo
iptables
-F
&&
iptables
-P
INPUT ACCEPT
⚠
Schedule with at now + 5 minutes before testing rules remotely.
$
sudo
ip
route
add default via 192.168.1.1
$
ssh-keygen
-R
hostname.example.com
[ PROCESSES ] — undo for signals & jobs
$
kill
-CONT
<pid>
$
fg
%1
$
disown
-h
%1
[ PACKAGES ] — undo for installs & upgrades
$
sudo
apt
remove
--purge
<package>
$
brew
switch
<formula>
<old-version>
══════════════════════════════════════════════════════════════════
$
█