MODULE 01 ยท 7 MIN READ
Time travel ๐ฐ๏ธ
This is the wow moment. If you can, open notes.txt in Notepad beside your terminal so you can watch it happen.
$ git log --oneline โ copy any ID
b2c3d4e Update notes
a1b2c3d Add course notes
$ git checkout a1b2c3d โ rewind
Note: switching to 'a1b2c3d' โ detached HEAD
$ git switch - โ back to the present
Switched to branch 'main'
Your files actually change on disk
The moment you check out the old commit, click into Notepad: the content flips to the old version, live. Git rewrote the folder to match the old snapshot. git switch - returns you to the present, and the file flips right back.
Every commit is a save point
This is why we commit often. Every commit is a save point you can always return to โ which means, as of today:
โYou can no longer destroy your project.โ
a tiny simulated laptop. six commands, zero consequences.
// make 2 commits, then: git checkout <first id> โฆ and git switch -