Skip to content

[bug]: Revert button only unstages files instead of reverting changes #1022

@thisisharsh7

Description

@thisisharsh7

Bug Description

The "Revert file changes" button (undo icon) doesn't actually revert file changes when the file is staged. It just unstages the file, which is redundant since there's already a separate unstage button (minus icon).

Steps to Reproduce

  1. Open a task and modify a file in the code editor
  2. Stage the file using the plus icon
  3. Click the revert button (circular arrow icon) next to the file
  4. The file gets unstaged but the changes are still there

Actual vs Expected Behavior

Actual: Clicking revert on a staged file only unstages it, keeping all the changes in the working directory.

Expected: Revert should discard all uncommitted changes and restore the file to the last committed version, regardless of whether it's staged or not.

emdash Version

latest

Operating System

macOS

Additional Context

The tooltip correctly says "Discard all uncommitted changes to this file and restore it to the last committed version", but the implementation was only unstaging staged files instead of actually reverting them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions