Personally, when I'm ready to submit a pull request, I usually do a soft reset to the point where I branched off from, then redo my commits and force push to the branch, for exactly that reason. I can't remember exactly which lines I've changed over the past few days unless I see all the diffs together.
That being said I don’t mind committing often. If I have a slew of small commits I squash them.
Since I will need to commit at some point, I rather do it incrementally.