-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to undelete specific files from git
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# Undelete a file from git which has been git-rm'ed and git-commit'ed somewhere in the | ||
# past. See https://stackoverflow.com/a/1113140/27401 | ||
# | ||
# Pass a filename (some_dir/some_file.txt) you want restored. | ||
|
||
git checkout $(git rev-list -n 1 HEAD -- "$1")^ -- "$1" |