sreenivas./courses
Git & GitHub for Beginners โ€” all lessons
a1b2c3d
b2c3d4e
c3d4e5f
โ† rewind

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 bash

$ 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.โ€

practice terminal โ€” you cannot break it

a tiny simulated laptop. six commands, zero consequences.

$ย 

// make 2 commits, then: git checkout <first id> โ€ฆ and git switch -