[BUG] "Restore to GitHub" prompt misinterpreted as push instead of pull
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:
- Have a git repository with uncommitted local changes
- 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_