Aug 22, 2024
git commit --amend
to change the last commit message.git log
to verify the new message.git add [file]
or git add -p
for partial staging.git commit --amend --no-edit
to add staged changes without changing the commit message.git log
or reference it via HEAD~n
.git rebase -i [sha or HEAD~n]
.pick
to edit
for the commit you want to modify.^
(caret) when referencing commits by SHA to indicate the parent commit.git commit --amend
.git rebase --continue
.git rebase --abort
to revert to the original state.git stash
to save uncommitted changes, then proceed with the rebase.git stash pop
to restore the stashed changes.