git reset --soft HEAD~1

after that, the changes can be sent back to stage and only the necessary file can be committed.