Skip to content

Regression: Copilot Undo reverts git-committed changes (similar to #3492) #284873

@tharveysa

Description

@tharveysa

Does this issue occur when all extensions are disabled?: No - requires Copilot extension

  • VS Code Version: 1.107.1
  • OS Version: Windows 11

Steps to Reproduce:

  1. Have Copilot (agent mode) edit File A (e.g., utils.ts)
  2. Do NOT click "Keep" - instead, stage and commit File A via git directly
  3. Push the commit to remote (git push)
  4. Have Copilot edit File B (e.g., api.config.ts) - do NOT commit
  5. Have Copilot edit File C (e.g., use-mobile.tsx) - do NOT commit
  6. Click "Undo" on the Copilot edits
  7. Dialog shows all files including File A (which was committed+pushed)
  8. Click "Yes" to proceed with undo
  9. File A is reverted, removing the COMMITTED changes

Result: Git now shows File A as modified - the pushed commit's content was removed by Undo.

Expected: File A should not be in the undo list at all since it was committed to git. Committing should clear the file from Copilot's undo tracking.

Workaround: Run git checkout HEAD -- <filename> to restore from commit.

Note: This appears to be a regression of microsoft/vscode-copilot-release#3492 which was marked fixed in March 2025.

Metadata

Metadata

Assignees

Labels

gitGIT issuesunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions