Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Undoing with git: discard, reset, revert
card 1 of 6
Three things went wrong. Which undo?
builds on: git status and reading a diff
An AI coding agent has worked in your project, and you find three kinds of trouble:
1. One file has uncommitted edits you don't want, but the other edits are fine.
2. Every uncommitted edit is bad.
3. A commit you made yesterday turns out to break something.
Each case needs a different git command. Two of these commands destroy work for good.
Terms on this card
- commit
- A saved snapshot of your project's tracked files that git can always return to.
- uncommitted
- Changes in your files that are not yet saved in any commit. Git has no copy of them.
- coding agent
- An AI tool that works inside your project: it can read files, run commands and edit code by itself, not just reply with text.
- command
- A line of text that tells the computer to run a program, typed in a terminal, for example `python src/cart.py`.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
Lesson goal: Choose the right undo. Discard uncommitted changes to files, return to the last commit, or revert a commit that is already made. Know which of these permanently loses work. ·
the whole lesson