This article is a follow-up to the comments from yesterday’s discussion about interactive adding. Many readers were eager to learn more about the powerful git add -p command, which is a shortcut to the patch mode
Piecemeal staging
Restoring lost commits
So, you just executed git reset –hard HEAD^ and discarded your last commit. But now you realize you really needed those changes.
Fixing broken commit messages
You just committed that awesome feature, test, or bug fix, but something isn’t quite right. Maybe some information is missing, the commit message is incorrect, or something else is off.