git-rescue
Skill0 starsChanged 3 months agoMITView on GitHub
Git救急手册:撤销、回滚、找回丢失提交、解决冲突.
- Deletes or force-pushes
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- chrisselig/claude-code-toolkittheir own version, first seen Oct 9, 2026
- 0xmortuex/claude-code-skillstheir own version, first seen Jul 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- chrisselig/claude-code-toolkit★ 1same name
- 0xmortuex/claude-code-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository219 other files it gives its agents.
- agent-doctrineSkill
- agent-evaluation-frameworkSkill
- agent-visualization-flintSkill
- hermes-agentSkill
- bailian-cliSkill
- edge-browser-automationSkill
- computer-useSkill
- jupyter-live-kernelSkill
- backup-strategiesSkill
- browser-automationSkill
- chinese-ai-free-apiSkill
- cicd-pipeline-templatesSkill
- copybaraSkill
- devops-toolkitSkill
- email-deliverabilitySkill
- monitoring-observabilitySkill
- obsidian-maintenanceSkill
- obsidian-troubleshootingSkill
- openclaw-windowsSkill
- openclaw-workerSkill
- webhook-subscriptionsSkill
- windows-dev-environmentSkill
- windows-masterSkill
- zero-downtime-deploySkill
- codebase-inspectionSkill
- github-workflowSkill
- adaptive-communicationSkill
- agent-cost-dashboardSkill
- agent-evolutionSkill
- agent-governanceSkill
- agent-osSkill
- context-efficient-toolsSkill
- context-loss-awarenessSkill
- creative-synthesisSkill
- hermes-desktop-pluginsSkill
- emotional-intelligenceSkill
- graph-engineering-workflowSkill
- hermes-maintenanceSkill
- hermes-voiceSkill
- hermes-hygieneSkill
- identity-coreSkill
- income-loopSkill
- master-synthesisSkill
- meta-cognitionSkill
- reasoning-engineSkill
- self-preservationSkill
- teaching-abilitySkill
- temporal-awarenessSkill
- hermes-themesSkill
- thinking-visualizationSkill
- user-modelingSkill
- voice-full-restoreSkill
- knowledge-graph-traversalSkill
- mcp-browser-canvasSkill
- free-api-gatewaySkill
- native-mcpSkill
- web-reverse-apiSkill
- ai-edaSkill
- huggingface-hubSkill
- industrial-ai-siemens-mcpSkill
- The first 60 shown.
The file
Files
Git 救急手册
借鉴 k88hudson/git-flight-rules (43k⭐)。
我搞砸了,怎么办?
改错了还没 commit
git checkout -- <file> # 撤销单个文件
git checkout -- . # 撤销所有修改
git restore <file> # Git 2.23+ 推荐commit 了但还没 push
git reset HEAD~1 # 撤销最新commit,改动保留
git reset --hard HEAD~1 # 撤销最新commit,改动也删
git commit --amend # 修改最新commit信息
git commit --amend --no-edit # 追加改动到最新commit已经 push 了
git revert <commit> # 创建新commit来撤销(安全)
git push origin main # push 撤销commit我在错误的分支上干活了
git stash # 暂存当前改动
git checkout correct-branch
git stash pop # 恢复改动到正确分支我 rebase 搞乱了一切
git reflog # 查看所有操作历史
git reset --hard HEAD@{2} # 回到rebase前的状态
# reflog 会保留30天的操作记录我 merge 错了分支
git reset --hard ORIG_HEAD # 回到merge前(merge后立即用)
git reflog # 如果已经做了其他操作找不回被删除的提交
git reflog # 找到删除前的commit hash
git checkout <hash> # 切到那个commit
git checkout -b rescue-branch # 基于它建新分支
git cherry-pick <hash> # 或把那个commit捡回来提交规范补救
把多个小commit合成一个
git rebase -i HEAD~3 # 交互式rebase最近3个commit
# 在编辑器里把除第一个外的 pick 改成 squash把一个commit拆成多个
git rebase -i HEAD~3
# 把要拆的 commit 标为 edit
git reset HEAD~1
git add file1.py && git commit -m "part 1"
git add file2.py && git commit -m "part 2"
git rebase --continue改很久以前的commit信息
git rebase -i HEAD~5
# 把要改的标为 reword,保存后编辑器会弹出让你改分支操作
基于远程分支创建
git fetch origin
git checkout -b feature origin/main把一个分支的改动移到另一个分支
git log feature-branch --oneline # 找到要移的commit
git checkout target-branch
git cherry-pick <commit-hash>删除远程分支
git push origin --delete old-branch查看历史
git log --oneline --graph --all # 图形化历史
git log -p <file> # 看某个文件的变更历史
git blame <file> # 看每行是谁改的
git diff main..feature # 两个分支的差异
git show <commit> # 看某个commit的详情黄金法则
- push 前什么都好办(reset/amend/stash)
- push 后用 revert(不要 reset --hard 已经 push 的)
- 遇到任何问题先 git status(看清楚当前状态)
- 不确定就先建备份分支(git checkout -b backup)
- reflog 是救命稻草(30天内所有操作都有记录)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

