Created
June 13, 2018 02:23
-
-
Save delphym/b3598bc91d685514693f94bd495e58cc to your computer and use it in GitHub Desktop.
Git related stuff, not even scripts, just commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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