docs/git/fixing-commits.md
This is mostly from here.
git commit --amend -m "New message"git add <filename> to add one file or git add <filename1> <filename2> ... to add multiple filesgit commit --amendgit rebase -i HEAD~5 (if, for example, you are editing some of the last five commits)pick to reword, and savegit rebase -i HEAD~n where n is the number of commits you are looking atpick to drop, and saveSometimes, you want to make one commit out of a bunch of commits. To do this,
git rebase -i HEAD~n where n is the number of commits you are interested inpick to squash on the lines containing the commits you want to squash and savegit rebase -i HEAD~n where n is the number of commits you are interested ingit push origin +my-feature-branch (Note the + there and substitute your actual branch name.)