From ce4193b0303a4929d3923ad6f5db89075abab233 Mon Sep 17 00:00:00 2001 From: thisisharsh7 <9u.harsh@gmail.com> Date: Sat, 21 Feb 2026 09:14:31 +0530 Subject: [PATCH] fix(git): revert button now discards changes instead of just unstaging --- src/main/services/GitService.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main/services/GitService.ts b/src/main/services/GitService.ts index 44a450e2f..6a358ee28 100644 --- a/src/main/services/GitService.ts +++ b/src/main/services/GitService.ts @@ -166,23 +166,6 @@ export async function revertFile( taskPath: string, filePath: string ): Promise<{ action: 'unstaged' | 'reverted' }> { - // Check if file is staged - try { - const { stdout: stagedStatus } = await execFileAsync( - 'git', - ['diff', '--cached', '--name-only', '--', filePath], - { - cwd: taskPath, - } - ); - - if (stagedStatus.trim()) { - // File is staged, unstage it (but keep working directory changes) - await execFileAsync('git', ['reset', 'HEAD', '--', filePath], { cwd: taskPath }); - return { action: 'unstaged' }; - } - } catch {} - // Check if file is tracked in git (exists in HEAD) let fileExistsInHead = false; try {