[BUG] "Restore to GitHub" prompt misinterpreted as push instead of pull

Open 💬 0 comments Opened Jun 13, 2026 by Bigfeta1

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Description:
When the user said "please restore this to the github branch," Claude interpreted this as a request to commit local
changes and push them to GitHub. The correct interpretation should have been to restore the local working directory to
match the remote GitHub branch (i.e., discard local changes and pull from remote).

Steps to reproduce:

  1. Have a git repository with uncommitted local changes
  2. Ask Claude: "please restore this to the github branch"

Expected behavior:
Claude should discard local changes and restore files to match the remote GitHub branch (e.g., git fetch origin && git
reset --hard origin/main)

Actual behavior:
Claude staged all local changes, committed them, and attempted to push to GitHub — the opposite of what was requested.

Severity: High — this action is destructive and irreversible (the commit was made before the user could stop it)

Suggested fix:
"Restore to [branch]" should be interpreted as restoring local state to match the named branch, not pushing local
state to it.

What Should Happen?

self evident

Error Messages/Logs

Steps to Reproduce

refer above

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.177

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

_No response_

View original on GitHub ↗