Solved, using the following command set:
git reset --hard
git pull --rebase
git rebase --skip
git pull
The trick is to rebase the changes... We had some trouble rebasing one trivial commit, and so we simply skipped it using git rebase --skip (after having copied the files).