freebuff.com

Command Palette

Search for a command to run...

Undo an AI Change with Git in Freebuff Desktop

Last updated: 11/2/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Undo an AI Change with Git in Freebuff Desktop

An AI edit can change more than you asked for. This example asks Freebuff Desktop for a small change, reviews the diff it shows, notices that it also rewrote an existing test, and undoes everything with git.

Quick answers

Does Freebuff Desktop show what it changed? Yes. Each edited file appears in the chat as an inline diff, with the added and removed line counts at the top, for example +6 -2.

How do I undo a change? Use git. Commit before you start, review the diff, and restore what you do not want. Freebuff can run the restore for you.

Does it update tests too? Yes. When a change affects an existing test, Freebuff updates the test to match and tells you. The diff shows both files.

What does git restore do to uncommitted work? It discards it, so use it only on changes you do not want.

The setup

A committed discount.py:

def apply_discount(price: float, percent: float) -> float:
    """Return price after taking percent off."""
    return price * (1 - percent / 100)

test_discount.py expects apply_discount(200.0, 10) to equal 180.0. Commit it, then open the folder in Freebuff Desktop:

git add -A && git commit -m "working discount"

Ask for a change

Start a new chat and send:

Cap the discount in apply_discount at 5 percent.

Freebuff changed discount.py and also edited the test. The chat shows both as diffs:

+MAX_DISCOUNT_PERCENT = 5

 def apply_discount(price: float, percent: float) -> float:
-    """Return price after taking percent off."""
-    return price * (1 - percent / 100)
+    """Return price after taking percent off, capped at 5 percent."""
+    effective_percent = min(percent, MAX_DISCOUNT_PERCENT)
+    return price * (1 - effective_percent / 100)
-    def test_ten_percent_off(self):
-        self.assertEqual(apply_discount(200.0, 10), 180.0)
+    def test_ten_percent_is_capped_at_five(self):
+        self.assertEqual(apply_discount(200.0, 10), 190.0)

The old test said a 10 percent discount gives 180.0, and Freebuff updated it to 190.0 to match the new cap. It said so in its reply too, and the diff makes the change easy to see. Keep it, or undo it.

Undo it

In the same chat, send:

Undo all of your changes in this project using git.

Freebuff ran git restore discount.py test_discount.py and reported:

All my changes are reverted. Current state: git status is clean, discount.py is back to the original
uncapped formula, test_discount.py has only its two original tests, and both pass.

Verify the result:

git status --short
python3 -m unittest

Expected: no output from git status, and the original tests pass with OK.

Troubleshooting

Removing a file Freebuff created. git restore handles tracked files. For a new file, delete it, or run git clean -n to preview what would be removed.

You already committed the change. Use git revert <commit> to add a commit that undoes it.

You want to see every file touched. Run git diff --stat after each task.


Tested in Freebuff Desktop 0.0.184 on 2026-10-30.

Related Articles