CodShot
Bash Public

Undo Last Commit Keep Changes

Undo the last commit but keep the changed files in your working directory.

#git #undo #commit #beginner
Bash
git reset --soft HEAD~1

Notes

This is useful when the commit message was wrong or you committed too early.

Snippet actions

CodShot user
CodShot user
Updated: 2026-06-03 15:31
Public snippets
0
Forks
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support