All fixes

Help, I forgot to add a file to my last commit

Add the missing file to the commit you just made, or follow up with a second commit if it is already pushed.

The fix

  1. git add styles.css

    Stage the file you forgot.

  2. git commit --amend --no-edit

    Folds it into the last commit and keeps the message. Everything else that is staged goes in too.

styles.css is an example. Replace it with your own.

What happens to your history
BeforeABCHEADmain
AfterABC′HEADmain

Why this works

--amend replaces your last commit with a new one that contains everything that is staged now, and --no-edit keeps the message. Because the commit is replaced, only do this before pushing. Once others may have it, a small follow-up commit is the honest and safe fix.