I have did git commit <file> for a file and also submitted that file with git submit <file>.
but now i want to un-commit the changes.
i have also tried git reset HEAD~1 <file> followed by git checkout -- <file>
but when i do git update it again comes as commited file.
can some one help me how can i un-commit my changes?

  • 1
    Simple.Commit the previous changes.
    – Thushi
    Jul 30 '15 at 8:21
  • 2
    Did you try git revert <commit> ?
    – neuron
    Jul 30 '15 at 8:49
  • 4
    What is git submit?
    – cuonglm
    Jul 30 '15 at 9:09
  • 1
    git update is also unknown to me.
    – yaegashi
    Jul 30 '15 at 9:12
  • 2
    If you've already published your commit to other people, I recommend you to do git revert and publish it again to avoid any troubles. Take extreme care when you attempt to rewrite the commit history.
    – yaegashi
    Jul 30 '15 at 11:44

Look at the various scenarios listed in the book for rewriting history:


If you need more assistance, please write what you wish to achieve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.