بنقرة واحدة
git
Apply when working with Git repositories, commit history, or recovering files from previous commits
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Apply when working with Git repositories, commit history, or recovering files from previous commits
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | git |
| description | Apply when working with Git repositories, commit history, or recovering files from previous commits |
Git operations with focus on commit history navigation and file recovery.
git rev-parse --show-toplevel--name-status to see A/M/D (Added/Modified/Deleted) per commit^ suffix)For installation, see SETUP.md in this skill folder.
# Last 10 commits, one line each
git log --oneline -10
# With file changes summary
git log --oneline --name-status -10
# With date and author
git log --format="%h %ad %an: %s" --date=short -10
# Show files with status (A=added, M=modified, D=deleted)
git show --name-status <commit_hash>
# Just the file list
git show --name-only <commit_hash>
# Full diff
git show <commit_hash>
# Show current HEAD
git log --oneline -1
# Show parent of HEAD
git log --oneline HEAD^ -1
# Show N commits back
git log --oneline HEAD~5 -1
# Compare two commits
git diff <commit1> <commit2> --name-status
To investigate commits one-by-one, walking backwards:
# Step 1: Start at HEAD, show what changed
git log --oneline -1
git show --name-status HEAD
# Step 2: Move back one commit, show changes
git log --oneline HEAD^ -1
git show --name-status HEAD^
# Step 3: Continue back (use ~2, ~3, etc.)
git log --oneline HEAD~2 -1
git show --name-status HEAD~2
# Pattern: HEAD~N where N = steps back from current
Tip: Your current position is always HEAD. Use git log --oneline -1 to confirm where you are.
# List all deleted files across history
git log --diff-filter=D --summary
# Find specific file deletion
git log --diff-filter=D --summary -- "**/filename.ext"
# Find EXACTLY which commit deleted a specific file (one-liner)
git log --diff-filter=D -1 -- path/to/file.ext
# With paths
git log --diff-filter=D --name-only --format="%H %s"
# Shows commits that touched the file (including deletion)
git log --all -- path/to/deleted/file.ext
# The first result is the deletion commit
# Use its parent (^) to get the version before deletion
# From commit that deleted it (^ = parent commit)
git checkout <deletion_commit>^ -- path/to/file.ext
# From known good commit
git checkout <good_commit> -- path/to/file.ext
# Alternative (Git 2.23+): git restore --source=<commit> -- path/to/file
# Using show (outputs to stdout, redirect to file)
git show <commit>:path/to/file.ext > recovered_file.ext
# View reflog
git reflog
# Recover from specific reflog entry
git checkout HEAD@{n} -- path/to/file.ext
When user needs to recover accidentally deleted files:
# Find recent deletions
git log --diff-filter=D --name-only --format="=== %H %s ===" -5
Note: If file was renamed (not deleted), use git log --follow -- oldname to track renames.
# Show what was deleted in that commit
git show --name-status <commit_hash>
# Check file in parent commit
git show <commit_hash>^:<path/to/file>
# Restore the file
git checkout <commit_hash>^ -- path/to/file
# Check file exists
Get-Item path/to/file
# Check status
git status
git log --diff-filter=D --name-only --format="" -n 20 | Where-Object { $_ -ne "" } | Sort-Object -Unique
# List files first
git show --name-only <commit>^
# Recover specific files
git checkout <commit>^ -- file1.ext file2.ext file3.ext
# Recover entire directory
git checkout <commit>^ -- path/to/directory/
# Between two commits
git diff <commit1> <commit2> -- path/to/file
# Between commit and working directory
git diff <commit> -- path/to/file
# Between commit and staged
git diff --cached <commit> -- path/to/file
git show <commit>:path/to/file
git reset --soft HEAD^
git reset --hard HEAD^
git checkout HEAD -- path/to/file
git reset HEAD -- path/to/file
git status
git status --short
git diff --cached
git diff --cached --name-status
git diff
git diff --name-status
# 1. Find what was deleted recently
git log --diff-filter=D --name-only -5
# 2. Identify the commit
git show <commit> --name-status
# 3. Recover
git checkout <commit>^ -- <file>
When /commit accidentally deletes a file:
# 1. Check last few commits for deletions
git log --diff-filter=D --name-status -3
# 2. Find the workflow file
git log --diff-filter=D -- "**/*.md" --name-only -5
# 3. Recover from parent of deletion commit
git checkout <commit>^ -- .windsurf/workflows/filename.md
# Find commits from today
git log --since="today" --oneline
# Compare start to end
git diff <first_commit> <last_commit> --name-status
Provides coding style rules for Python and PowerShell. Apply when writing, editing, reviewing, or debugging code.
Apply when conducting deep research on technologies, APIs, frameworks, or other software development topics requiring systematic investigation
Apply when doing planning for long-running tasks in sessions on top level
Apply when committing code, writing commit messages, or configuring .gitignore
Apply when working with GitHub repositories, issues, PRs, or authentication
Apply when interacting with Google services (Gmail, Calendar, Drive, Tasks) via gogcli CLI