- Remove last commit, keep the index tree, and keep the changes:
git reset --soft HEAD^
- Remove last commit, remove the index tree, and keep the changes:
git reset HEAD
Ref: 1
- ignore files that have already been committed to the repo: https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git/