How to commit the two two changes done together

If I want to commit the changes I have done later. for ex. in the third file if I want to commit the pink part of the change what should I do?

you do that by calling git add again, git commit only commit the changes added to the staging area, as you have added the green change part to staging area, it gets committed and pink part doesn’t. If you want to commit that too first call git add to add the changes to staging area and then git commit to commit those changes.