Hands-on task
Restore a file in both the index and the working tree
In /root/repo the file f.txt in the last commit contains v1. Then it was changed to v2 and staged (git add), and after that the working copy was changed once more to v3 (without staging). Right now three versions have diverged: the commit is v1, the index is v2, the working tree is v3. Return f.txt fully to the version from the last commit: both the index and the working tree should be v1 again. Don't touch the commit history.
- git restore
- index
- working tree
- staging area
- reverting a file