Reverting and discarding

Until now, we've used revert to undo the latest Commit. However, revert isn't limited to just that; it can restore a Branch back to even earlier Commits, going back to the very first Commit if needed. To do this, we simply need to find the Commit we want to restore in the branch, and then revert the Commit above that. This makes sense because we're effectively reverting all commits subsequent to the chosen one. Simply right-click on the Commit above the latest, and choose Revert commit. For this example, I am reverting to the first commit:

Reverting to an earlier Commit

If you now open a Windows Explorer or Mac Finder ...

Get Mastering Unity 2017 Game Development with C# - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.