feat(git): use soft reset to keep changes staged on undo
Change undo-last-commit behavior to perform a soft reset instead of a mixed reset. This preserves the index and working tree so the undone commit's changes remain staged and ready to recommit. The confirmation dialog text was updated to accurately reflect the new behavior. - Perform git reset --soft HEAD~1 to move HEAD while preserving index - Update UI confirmation copy to state that changes remain staged and files are preserved
This commit is contained in:
+1
-1
@@ -4719,7 +4719,7 @@
|
||||
async function undoLastCommitChange() {
|
||||
if (!activeRepoPath || !canAmend || isBusy) return;
|
||||
const confirmed = window.confirm(
|
||||
"Undo the last commit?\n\nIts changes come back as uncommitted changes in the working tree — nothing is discarded.",
|
||||
"Undo the last commit?\n\nIts changes remain staged, ready to commit again. Your working tree files are preserved.",
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user