Using Gits Patch functionality to commit parts of a file

Have you ever been going through some code while working on a feature and found some minor things that needed to be fixed and you just couldn't help yourself but fixed them right away? I know I have. More than once. The issue is that when I'm done with the original feature I will have some changes in the same file that shouldn't be in that same commit. What to do?

Tags git patch workflow