reset-to-main

Reset the Git working directory to the main branch safely.

3|1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/denniscalazans/denniscalazans-plugins --skill reset-to-main
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reset-to-main
Source: https://github.com/denniscalazans/denniscalazans-plugins/tree/main/plugins/dc/skills/reset
Command: npx skills add https://github.com/denniscalazans/denniscalazans-plugins --skill reset-to-main

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you safely return your Git repository to a clean state on the main branch, ensuring no work is lost and the working directory is tidy.

Core Features & Use Cases

  • Safe Reset: Returns you to the default branch (main or master) with a clean working directory.
  • Branch Management: Optionally cleans up local branches that have already been merged.
  • Context Switching: Ideal for when you've finished a task and need to switch contexts or start fresh.

Quick Start

Use the reset skill to return to the main branch with a clean working directory.

Frequently Asked Questions about reset-to-main

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely reset my Git workspace to the main branch without losing uncommitted changes?

To safely reset your Git workspace to the main branch, the Skill evaluates staged, unstaged, and untracked files, offering options to stash, move to a worktree, or discard changes before switching branches and pulling updates.

What is the best way to clean up local Git branches after merging a feature?

Cleaning up local Git branches after merging is handled by integrating with the clean-branches skill, which prunes merged local branches automatically after you switch back to the main branch with a clean working directory.

How does Git branch management handle untracked files when switching contexts?

Git branch management handles untracked files by determining branch integration status and providing choices to safely stash, move to a worktree, or discard untracked files before executing a branch switch and pulling main updates.

Can I move uncommitted Git changes to a worktree instead of stashing or discarding them?

Yes, you can move uncommitted Git changes to a worktree, as the Skill explicitly offers options to stash, move to a worktree, or discard changes when resolving staged, unstaged, and untracked files during a reset.

Does resetting a Git working directory to main automatically pull the latest updates?

Yes, resetting a Git working directory to main automatically pulls updates, ensuring the repository reflects the latest state after safely handling any existing staged, unstaged, or untracked files.