sreenivas./courses
Git & GitHub for Beginners — all lessons
🔀

MODULE 02 · 5 MIN READ

Prove the universes are separate

Commit a file on idea, then jump back to main — and watch the file vanish from the working directory. It isn't deleted; it lives in the other universe.

Switching branches rewrites your folder to match the universe you're standing in — the same mechanic as yesterday's time travel, but between live timelines instead of old snapshots.

git bash

$ touch experiment.txt

$ git add .

$ git commit -m "Try a wild idea"

$ git switch main

Switched to branch 'main'

$ ls

notes.txt

COMMIT GRAPH · on branch main

a1b2cmain ← HEAD
practice terminal — you cannot break it

a tiny simulated laptop — your Day 1 repo is preloaded.

$ 

// try: touch experiment.txt → git add . → git commit -m "Try a wild idea" → git switch main → ls → git switch idea