Logo hdtoledo
hdtoledo.dev
Módulos_del_Sistema
EJERCICIO_PRÁCTICO

Time Travel: History

Time Travel: Reading History

1. View History (Log)

bash
git log git log --oneline

2. View Differences (Diff)

If you modified a file but haven't staged it yet, you can see changes:

bash
git diff

3. Undo Changes

If you messed up an uncommitted file:

bash
git restore filename.txt

Practical Exercise

  1. Modify your index.html.
  2. Run git diff.
  3. Run git restore index.html and see the changes disappear.
  4. Make a new change, commit it, and check git log --oneline.