Provided you have fixed the permissions problem:
git clean -d
git reset --hard
git merge --ff-only origin/master
Question
Git pull on remote production server stopped prematurely because of wrong permissions:
lucy@brambor src $ git pull
...
Updating 45e2051..80f6f43
error: unable to create file src/templates/s/logo.eps (Permission denied)
Now the permissions should be fixed, but the repo is broken, what do I do? I am novice in git and it's critical not to do a mistake now, that's why I'm asking here.
lucy@brambor src $ git status
# On branch master
# Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: templates/base.html
# deleted: templates/howto.html
...
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# templates/management.html
# templates/recaptcha.html
...
no changes added to commit (use "git add" and/or "git commit -a")
Solution
Provided you have fixed the permissions problem:
git clean -d
git reset --hard
git merge --ff-only origin/master