- Sometimes when programming, we introduce bugs that break the software we work on. Git can be used to easily revert the change that broke the program.
- Identify the commit to be reverted
- Use Git revert to undo the mistake
- Commit the revert
- Sometimes, we need to correct errors in commits. Either by editing the message or by modifying its contents. We can also completely undo a commit or commits.
- git revert commit_ID (syntax).
Git, Git Commands
We have learned how to view the names of changed files using git status.
How do we view the exact changes we made since the last commit?
The git diff command allows us to do this.