git commit -a -m "wrong commit, needs changes" # commit only staged changes, miss untracked changes
git add forgotten_file edited_file ... # stage the changes to fix previous commit
git commit --amend --no-edit # commit staged changes, without editing commit message
git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any
git commit --amend --reset-author # revise commit author info (for when done as wrong user)
revertcreates new commit(s) to undo commit(s).resetdiscards a commit.
Following command discards the last commit completely.
git reset --hard HEAD~1