Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Remove file added accidentally in last commit

  • Create a bunch of files. Some we would like to track some we don’t.
  • Use git add . to add all the files.
  • git commit -m "add all the files" to commit.
  • Realized we added files we did not want to.
  • Remove the unwanted files git rm --cached FILENAME (but keep them in the workdir.
  • git commit -m "add only the important files" --amend