Saving Your Work
status, log, diff — and pushing to GitHub
Checking your work
Before and after committing, there are three commands that help you understand what’s going on:
git status — What’s changed?
git statusThis shows:
- Untracked files — new files git doesn’t know about yet
- Modified files — existing files that have changed
- Staged files — files ready to be committed
Run this frequently. It’s your dashboard.
git log — What have I committed?
git log --onelineThis shows a list of your commits, newest first:
a1b2c3d Add contact form with validatione4f5g6h Update homepage hero sectioni7j8k9l Initial commitEach line shows a unique commit ID (the letters/numbers) and your commit message. The --oneline flag keeps it compact.
git diff — What exactly changed?
git diffThis shows line-by-line what changed in your files since the last commit. Lines starting with + were added, lines starting with - were removed.
<h1>Welcome</h1><h1>Welcome to My Portfolio</h1>Undoing mistakes
One of git’s greatest powers is letting you undo things:
Undo changes to a specific file (before committing)
git checkout -- filename.txtThis reverts the file to its last committed version. The changes are gone.
Undo all changes since last commit
git checkout .This reverts all files. Use with caution — all uncommitted changes are lost.
Undo the last commit (keep the changes)
git reset --soft HEAD~1This undoes the commit but keeps your file changes. Useful when you committed too early or with the wrong message.
Before running any AI tool or making big changes, do a quick git add . && git commit -m "Save point before changes". This guarantees you can always get back to a working state.
Pushing to GitHub
So far everything has been local — saved on your computer only. To back up your work and share it, push to GitHub.
Step 1: Create a GitHub repository
- Go to github.com and sign in (create an account if needed)
- Click the + button → New repository
- Name it (e.g.,
my-project) - Keep it Public or Private — your choice
- Don’t add a README, .gitignore, or license (you already have files)
- Click Create repository
Step 2: Connect your local project to GitHub
GitHub will show you commands. Copy and run them:
git remote add origin https://github.com/YOUR-USERNAME/my-project.gitgit branch -M maingit push -u origin mainLet’s break these down:
git remote add origin— tells git where to upload (the GitHub URL)git branch -M main— renames your branch to “main” (the convention)git push -u origin main— uploads your commits to GitHub
Step 3: Future pushes
After the initial setup, pushing new work is just:
git pushOne command. Your code is backed up in the cloud.
The daily workflow
Here’s the complete workflow you’ll follow for every project:
# Start of work sessiongit status # Check current state
# Make changes (AI tools, manual editing, etc.)claude # or gemini, codex, etc.> "Add a navigation bar to the site"
# Save your workgit add .git commit -m "Add responsive navigation bar"
# Back up to GitHubgit pushRepeat this cycle as many times as you like during a session. Each commit is a save point. Each push is a backup.
Quick reference
| I want to… | Command |
|---|---|
| See what’s changed | git status |
| See commit history | git log --oneline |
| See exact changes | git diff |
| Stage all changes | git add . |
| Commit changes | git commit -m "message" |
| Push to GitHub | git push |
| Undo uncommitted changes | git checkout . |
| Undo last commit (keep files) | git reset --soft HEAD~1 |
You now know enough git for 95% of what you’ll do as an orchestrator. There’s much more to git (branches, merging, rebasing), but you can learn those when you need them — and even then, you can ask your AI tool to help you with the commands.