devlk

devlk: developer community for careers, salaries and remote work

c/learningu/devlk Team

How do I undo a commit in Git?

Team FAQ: this question comes up often, so we've answered it below. Add your own experience, or a different view, in the comments. You committed something by mistake: the wrong files, a bad message, or on the wrong branch. How do you undo it safely?