Interview Prep/Git & GitHub/Undoing changes: reset, revert, restore and reflog

How do you remove a file from the last commit but keep it on disk?

IntermediateConceptUndoing changes: reset, revert, restore and reflog
Answer

git rm --cached stages the removal, then amend.

git rm --cached secrets.json
git commit --amend --no-edit
All Git & GitHub questions Roadmap: Git & GitHub

More on Undoing changes: reset, revert, restore and reflog