How do I undo my last Git commit without losing the changes I made?
beginner
· 5 views ·
asked 3 days, 11 hours ago
by Tai
0
Context
Working on a feature branch in a local Git repository. I ran git commit -m "WIP" before finishing the change, and I have NOT pushed the commit anywhere yet.
Expected
I want to remove the last commit from the branch history but keep all the edited files exactly as they were, so I can finish the work and make a clean commit.
What Happened
I'm not sure whether to use git reset --soft, --mixed, --hard, or git revert, and I'm worried the wrong one will permanently delete my changes.
Question comments
Short clarifications and small follow-ups about the question itself.
No comments on the question yet.
0 Answers
No answers yet. Be the first to help!