NonDev Apps

Day 12 of 21

How to review a diff before accepting changes

Goal: Learn to read what Codex actually changed, spot unexpected edits before committing, check user-facing text, and handle the case where two sessions may have touched the same file.

What to do

01

Read added and removed lines in the diff

Open GitHub Desktop and click on a changed file in the left panel. The right side shows the diff. Green lines with a + were added by Codex. Red lines with a - were removed. Lines with no color or symbol were not touched. Read the changed lines carefully — do they match what you asked Codex to do, word for word, If a green line contains text you do not recognise, that is a flag.

02

Check the full list of changed files — not just the one you expected

Before reading any individual diff, look at the full list of changed files in the left panel of GitHub Desktop. Compare that list to what you asked for. A safe session changes only the files you expected. If any file name surprises you — especially anything that sounds like config, package, database, auth, or payments — do not commit until you understand why it changed.

03

Check user-facing text carefully

Scroll through the diff and find any lines that contain text a real user would see — headings, button labels, navigation items, placeholder text, error messages, or page copy. Read those lines out loud as a first-time visitor would. Does the text make sense, Does it match what you asked for, Codex sometimes changes copy that was not part of your request, or introduces awkward phrasing while making a structural change.

04

Handle the case where two sessions changed the same file

If you ran multiple Codex sessions without committing between them, the diff may show changes from both sessions layered on top of each other. This makes it hard to tell which change came from which session. If this happened, the safest action is to discard all changes in GitHub Desktop, commit the clean state, and then redo only the first session's work — one session, one commit. Going forward: always commit after each session, even if the work is small.

05

Accept, discard specific files, or ask Codex to revise

After reading the full diff and all changed files, make a clear decision. Accept all: every file and every change matches what you asked for — commit with a clear message. Discard specific files: most looks right but one or two files changed unexpectedly — right-click those files and discard, then commit the rest. Ask for revision: the changes are close but not quite right — type a specific correction prompt to Codex before committing anything.

Decision guide — use this before committing: If the diff matches your request exactly: Commit with a message that describes the change. Example message: "Change homepage heading to Start Here" If one file looks wrong but the rest are correct: Right-click the wrong file in GitHub Desktop > Discard Changes Then commit the remaining files. Ask Codex: "I discarded [FILE NAME]. Please explain why it changed." If the diff does not match your request: Do not commit anything. Ask Codex: "The diff shows [DESCRIBE WHAT IS WRONG]. I asked for [YOUR REQUEST]. Please revise."

Expected result

You can read a GitHub Desktop diff, identify added and removed lines, spot unexpected file changes, check user-facing text, recognise mixed-session diffs, and make a deliberate accept-discard-revise decision before committing anything.

Key takeaway

  • A diff is your receipt. Read it before committing anything. Every unexpected file or unexpected line change is a question you must answer before you save the work. Commit only what you understand.
Day 12 - How to review a diff before accepting... - NonDev Apps