课程: Git from Scratch

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

git revert: Undo something

git revert: Undo something - Git教程

课程: Git from Scratch

git revert: Undo something

- [Instructor] One of the most powerful features of any software tool is the undo button. Make a mistake, hit undo, and it's as if it never happened. That's kind of tricky though when you have an omnipotent, passive observer of all things watching and keeping track of the history of your project. How do you undo something you've committed to history without rewriting history? The answer is you can actually rewrite history using the git reset command, but it's rather risky and not good practice to do so. A better solution is to work with the historical timeline and simply pull an older version of your code up to the top of the branch. This is done using git revert. For this to work, you need to know the commit ID for the commit you want to revert to. This is a machine-generated pile of random numbers and letters also known as a hash. To get the list of everything that's happened in the repository, including the…

内容