How do you undo the last commit but keep the changes?

BeginnerConceptGit
Answer
git reset --soft HEAD~1     # changes stay staged
git reset HEAD~1            # changes stay, unstaged (--mixed)
All Real-World Interview questions Roadmap: Interview readiness

More on Git