Add to .bashrc or .bash_profile
function git_undelete_file () {
if [ $# -eq 0 ]; then
echo "Usage: git_undelete_file <filepath>";
exit 1;
fi
git checkout $(git rev-list -n 1 HEAD -- "$1")^ -- "$1"
}
Add to .bashrc or .bash_profile
function git_undelete_file () {
if [ $# -eq 0 ]; then
echo "Usage: git_undelete_file <filepath>";
exit 1;
fi
git checkout $(git rev-list -n 1 HEAD -- "$1")^ -- "$1"
}