How to remove a file from staging in Git

Removing files from the staging area allows you to exclude them from the next commit while preserving the changes in your working directory. As the creator of CoreUI with extensive Git experience across numerous projects, I regularly unstage files when preparing selective commits or when files were added accidentally. The most straightforward approach uses git reset HEAD with the file path to remove it from staging. This method provides precise control over what gets committed while maintaining your working directory changes.

Use git reset HEAD filename to remove a specific file from the staging area while keeping your changes.

git reset HEAD src/components/Button.js

This command removes the specified file from the staging area (index) but leaves your modifications intact in the working directory. The file returns to an unstaged state, allowing you to review changes, make additional edits, or choose not to include it in the current commit. This is particularly useful when you’ve accidentally staged files or want to commit changes in smaller, logical chunks.

Best Practice Note:

This is the selective unstaging method we use in CoreUI development for precise commit preparation and change organization. Use git status after unstaging to verify the file is no longer staged and review what changes remain in your working directory.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author