How to select specific change of one file to include in work tree - Anjum219/Git-basics GitHub Wiki
Often we make some changes in a file, for addressing pull request comments or some other reasons, then we realize, we had to make commits separately for each change. Then we would probably undo them and make commits or use whatever hack comes in our minds. git has already an interactive hack for this!
Just try
git checkout -p
An interactive tool will be open in your terminal and ask you if you want to include this change in your work-tree.