From the course: Complete Guide to Git

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Restore other versions

Restore other versions - Git Tutorial

From the course: Complete Guide to Git

Restore other versions

- [Instructor] In this movie, we'll learn how to restore other versions of a file, besides the most recent version. In the previous movie, we learned to use Git Restore Command to restore the most recent version of a file to the working directory or to the staging index. Let's imagine that while we're developing, we really wish we could get back an even older version of a file. We don't want to just see the changes that took place, we want the actual file in our working directory so we can work with it. Git has been tracking our changes since our first commit. It maintains records of how files looked at every commit along the way. We just have to tell it which version we want to restore. Again, we'll use the restore command, but this time we'll add the dash dash source option followed by an equal sign and an identifier for the version of the file that we want. This example will return file TXT as it existed in the repository, after the commit 6a94c13d was added. It restores the file…

Contents