If you have comitted wrong files to git and you want to undo it, here is what you can do : $ git commit - m "Some comment here" ( 1 ) $ git reset HEAD ~ ( 2 ) << edit files as necessary >> ( 3 ) $ git add ... ( 4 ) $ git commit - c ORIG_HEAD ( 5 ) This is what you are looking to undo This leaves your working tree (the state of your files on disk) unchanged but undoes the commit and leaves the changes you committed unstaged (so they'll appear as "Changes not staged for commit" in git status and you'll need to add them again before committing). If you only want to add more changes to the previous commit, or change the commit message 1 , you could use git reset --soft HEAD~ instead, which is like git reset HEAD~ but leaves your e...