Skip to content

Instantly share code, notes, and snippets.

@delphym
Created June 13, 2018 02:23
Show Gist options
  • Save delphym/b3598bc91d685514693f94bd495e58cc to your computer and use it in GitHub Desktop.
Save delphym/b3598bc91d685514693f94bd495e58cc to your computer and use it in GitHub Desktop.
Git related stuff, not even scripts, just commands
#!/bin/bash
# Script origin @ https://gist.github.com/delphym/b3598bc91d685514693f94bd495e58cc#file-git-undo-sh
## To recover all unstaged deletions at once, automatically, without specifying each single path:
git ls-files -d | xargs git checkout --
## To recover all staged deletions at once, automatically, without specifying each single path:
# git status | grep 'deleted:' | awk '{print $2}' | xargs git checkout --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment