see changes and revert back

Excellent — since you already used:

repo forall -c 'git status --short'

…you now know which files have changed. Let’s now go step-by-step to:


1. See What Changes You Made

To view exactly what was changed (line by line) in each file:

🔍 View changes in a specific file

git diff path/to/file

Example:

git diff modules/java-middleware/Android.bp

🔍 View all changes across the repo

If you want to see all your local edits:

git diff

🔁 2. Revert Changes and Get Back to Original

Depending on the file status, you have two options:

🟢 A. Revert modified files (those with M)

Use:

Example:

If you want to restore all modified files:

💡 git restore is safe and doesn't touch untracked files.


🟡 B. Remove untracked files (those with ??)

These are files Git is not tracking (e.g., new .apk, new .bp, new folders).

To delete all untracked files and directories:

🧹 Dry run (safe to check first)

🧹 Remove untracked files only

🧹 Remove untracked files and directories

⚠️ Warning: This is irreversible. Don’t run unless you're sure.


🔒 Tip: Work Per Project with repo forall

If you want to see diffs across all projects:

To revert all changes in all projects:


📘 Summary

Task
Command

See changes in file

git diff path/to/file

See all changes

git diff

Restore modified file

git restore path/to/file

Restore all modified files

git restore .

See untracked files

git status

Delete untracked files

git clean -f

Delete untracked files & folders

git clean -fd


Would you like a script that summarizes the changes across all modules and lets you choose what to revert?

Last updated