// The '.' is needed to attached HEAD! $ git checkout <commit_id> . $ git add . $ git commit -m "go back to <commit-id>" $ git push // checkout source for full details!