GIT - Recover a deleted file Apr 1, 2018 file="$filepath" git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"