# Undo the last commit but keep the changes staged
git reset --soft HEAD~1
# Or undo and unstage the changes (working tree preserved)
git reset HEAD~1Updated Jul 17, 2026
# Undo the last commit but keep the changes staged
git reset --soft HEAD~1
# Or undo and unstage the changes (working tree preserved)
git reset HEAD~1#!/usr/bin/env bash
set -euo pipefail
for file in src/**/*.ts; do
echo "Processing $file"
npx prettier --write "$file"
done