The way Git is used is usually like this:
- edit files;
- stage the files, either some of them or all of them;
- when the stage looks good, you commit it;
- the files not previously staged, could then be staged and committed later;
- you reiterate this process creating a new stage (another set of files), and committing it, and so forth;
Hence if you want to commit a subset of the modification resulting by a long editing session, just stage only some files and commit those.
As usual, the advice is to keep your changes in a small related set inside a commit, avoiding at all costs the huge meaningless commit of unrelated changes.
An update regarding branches:
If what you need is to put aside some changes you created on the master branch and work on something else, you could store temporarily your changes on another local branch, such as:
- create a new branch called "temp_changes" (new branch);
- switch to it (checkout);
- stage the editing you want to store in this branch
- commit the stage;
- switch back to master branch (checkout);
Thereafter you could work on master branch unaffected by those modification that now are stored in _temp_changes_ branch only. You could also push this branch remotely if you need to share it with anyone else or to store it safely.