If we've already committed changes that we don't want to push, we can also remove those with git reset
, but we're going to reset back to a specific commit, either with:
git reset HEAD~1
or
git reset [HASH]
and that will effectively "undo" the commits before that hash.
Then we can add and commit only the changes that we want.