Read more

Unstage an added file in Git

Henning Koch
September 07, 2010Software engineer at makandra GmbH

If you added a file by mistake, you can unstage it (but keep local changes) by saying

git reset HEAD path/to/file
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

This is also what git status will tell you.

NB: It works for conflicts, too, if git checkout -- <file> does not (although git tells you it would).

Posted by Henning Koch to makandra dev (2010-09-07 19:47)