Get a list of files you want to commit
$ git status
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file1
modified: file2
modified: file3
modified: file4
Add the files to staging
$ git add file1 file2
Check to see what you are committing
$ git status
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: file1
modified: file2
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file3
modified: file4
Commit the files with a commit message
$ git commit -m "Fixed files 1 and 2"
If you accidentally commit the wrong files
$ git reset --soft HEAD~1
If you want to unstage the files and start over
$ git reset
Unstaged changes after reset:
M file1
M file2
M file3
M file4