Snippets
Snippets / Tags
recovery
3 recovery code snippets across 1 language. Copy-paste solutions from production code.
3
snippets
git
3 snippetsRecover a Deleted Git Branch with reflog
Use git reflog to find and restore a branch you accidentally deleted with git branch -D or a botched rebase.
gitreflogrecovery+2
INTERMEDIATEMay 2, 2026
Remove Untracked Files Safely with git clean
Use git clean -n to preview what will be deleted, then -fd to actually remove untracked files and empty directories. Without losing work.
gitcleanuntracked+2
INTERMEDIATEJun 17, 2026
Undo the Last Git Commit (Keep or Discard Changes)
How to undo the most recent git commit using git reset, with --soft, --mixed, and --hard explained side by side.
gitresetundo+2
BEGINNERApr 10, 2026