The best way to list these file is using git status --porcelain.

For example:

git status --porcelain | awk 'match($1, "D"){print $2}' 

shows you the tracked files which have been deleted from the local copy. You can delete all these files by appending an appropriate command to the pipe:

git status --porcelain | awk 'match($1, "D"){print $2}' | xargs git rm
Answer from Alex Sharapov on Stack Overflow
🌐
Graphite
graphite.com › guides › git-view-changes
How to view changes in Git - Graphite
Commit: This is the action of recording changes from the staging area to the repository. git diff is a versatile command used to show differences between commits, commit and working tree, etc.
Discussions

made some changes to local files, didn't commit, git says it's up to date
git status is your friend. Not only will it list the files and say they're not staged for commit, but it will tell you what you want to do: Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) If you look at that and really say "I just want to undo all my changes," the easiest thing is probably git restore . from the root. (That will restore the edited files, but will not remove files that you added.) If you might(?) want these changes later, look into git stash push instead. More on reddit.com
🌐 r/git
16
8
May 4, 2021
git - How to list only the names of files that changed between two commits - Stack Overflow
Note that it is possible to change ... without changing their contents. ... Save this answer. ... Show activity on this post. ... where you only need to include enough of the SHA hash to identify the commits. The order of the SHAs does not matter. The output (which includes the relative path, not just the file name) follows this format: dir 1/dir 2/filename.ext dir 3/dir 4/other filename.ext ... Sign up to request clarification or add additional context in comments. ... This works for git show as ... More on stackoverflow.com
🌐 stackoverflow.com
git - How do I list all the files in a commit? - Stack Overflow
And unlike the accepted answer, git show also works for reviewing stashed changes: e.g. git show --stat --oneline stash@{1} 2017-07-26T19:00:29.273Z+00:00 ... this is what I've really needed ! unlike " git diff-tree --name-status -r ", with this command I may see affected files in the ... More on stackoverflow.com
🌐 stackoverflow.com
Is there a way to show the files that are changed on git push?
What will I push (if the push works)? git diff @{push} @ What did I just push? git diff @{push}@{1} @{push} If you just want file names, not diff hunks, --name-only These use the revision-naming language, man gitrevisions for more details. If your pull and push remotes are the same you can use the shorter @{u} instead of @{push}. These refer to a remote-tracking branch. (It's possible to set local upstream branches but much less common to use push with them.) An RTB remembers which revision you saw on the server most recently. More on reddit.com
🌐 r/git
11
4
December 4, 2023
People also ask

Git Diff - Inspecting Changes in Git
git diff shows the line-by-line differences between two states of your repository, with lines prefixed by + (added) and - (removed). Running git diff with no arguments shows unstaged changes — the difference between your working directory and the index (staging area). To see only staged changes (what will be included in the next commit), use git diff --cached or git diff --staged. To compare two specific commits, run git diff ; to compare two branches, use git diff ... Narrow the output to a specific file by appending its path: git diff HEAD -- path/to/file, and add --stat to get a summary of
🌐
git-tower.com
git-tower.com › learn › git faq › git diff - inspecting changes in git
Git Diff - Inspecting Changes in Git | Learn Version Control with Git
🌐
Opensource.com
opensource.com › article › 21 › 4 › git-whatchanged
Find what changed in a Git commit | Opensource.com
... $ git log --raw commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) Author: tux <tux@example.com> Date: Sun Nov 5 21:40:37 2020 +1300 exit immediately from failed download :100755 100755 cbcf1f3 4cac92f M src/example.lua ...
🌐
Calmcode
calmcode.io › til › git-differences
TIL: Show Changed Files in Git.
This project might have lots and lots of files that need checking on every commit. But maybe, some of the automated checks only need to run on a subset of all the files. Maybe they should only run on the files that actually changed. ... This compares the current git state with the main branch that you have locally.
🌐
Git
git-scm.com › book › en › v2 › Git-Basics-Recording-Changes-to-the-Repository
2.2 Git Basics - Recording Changes to the Repository
This command compares your staged changes to your last commit: $ git diff --staged diff --git a/README b/README new file mode 100644 index 0000000..03902a1 --- /dev/null +++ b/README @@ -0,0 +1 @@ +My Project · It’s important to note that git diff by itself doesn’t show all changes made ...
Find elsewhere
🌐
Git Tower
git-tower.com › learn › git faq › git diff - inspecting changes in git
Git Diff - Inspecting Changes in Git | Learn Version Control with Git
4 days ago - $ git diff --staged index.html # Staged changes in all local files... $ git diff --staged · Another helpful option is --color-words. Instead of the "classic" display mode in diffs, where old and new contents are displayed in separate lines, ...
🌐
OpenReplay
blog.openreplay.com › openreplay blog › how to identify modified files after a git commit
How to Identify Modified Files After a Git Commit
March 4, 2025 - Navigate to your repository on GitHub. Click on Commits in the repository. Click on the commit you want to inspect. You will see a list of modified files along with the changes in the commit.
🌐
GitHub
gist.github.com › 708777a4592e2818231d
Git, show all changed files · GitHub
Git, show all changed files · Raw · git_change · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters ·
🌐
Tosbourn
tosbourn.com › articles › web dev › git command to show files changed in a commit
Git command to show files changed in a commit - Tosbourn
Review of Tosbourn Ltd.
Where git log is better is when you want to show more than just that one commit. ... This will recursively (visit all folders) list the files that have changed, like git show we can pass some additional parameters to tidy the output up. Toby had helped shape the digital team practice around Agile and ways of working on multidisciplinary teams, which was new to a lot of folks. I only heard great feedback about people's experience working with Toby - how inspiring and humble he is as a leader.
Rating: 5 ​
🌐
Reddit
reddit.com › r/git › made some changes to local files, didn't commit, git says it's up to date
r/git on Reddit: made some changes to local files, didn't commit, git says it's up to date
May 4, 2021 -

Okay, so say I pulled/fetches some files from repo, then I made some minor changes to some of them.

However, upon realizing I don't want these changes, I now want to have previous version of those files. It's not easy for me to manually edit them back to previous status. So I wanted git to check integrity of these files and see if they match with the remote repo, if not, then replace them.

However, upon doing "git pull" or git fetch or whatever, git says my local repo is up to date.

The only way I can pull the current files from remote repo, is if I clone entire repo, but that's wasteful.

I only need a few files to update. Even if I delete them, I don't know how to force git to add their current versions from remote repo.

🌐
GitHub
education.github.com › git-cheat-sheet-education.pdf pdf
GIT CHEAT SHEET STAGE & SNAPSHOT
show the commits that changed file, even across renames · git diff branchB...branchA · show the diff of what is in branchA that is not in branchB · git show [SHA] show any object in Git in human-readable format · IGNORING PATTERNS · Preventing unintentional staging or commiting of files · git config --global core.excludesfile [file] system wide ignore pattern for all local repositories ·
🌐
Git
git-scm.com › book › en › v2 › Git-Basics-Viewing-the-Commit-History
Git - Viewing the Commit History
As you can see, the --stat option prints below each commit entry a list of modified files, how many files were changed, and how many lines in those files were added and removed. It also puts a summary of the information at the end. Another really useful option is --pretty.
🌐
Jpalardy
blog.jpalardy.com › posts › git-how-to-find-modified-files-on-a-branch
Git: How to Find Modified Files on a Branch | Jonathan Palardy's Blog
February 29, 2020 - ... git diff [<options>] <commit>...<commit> [--] [<path>...] This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>. "git diff A...B" is equivalent to "git diff $(git merge-base A B) B".
🌐
LichtenBytes
mlichtenberg.wordpress.com › 2021 › 12 › 21 › finding-everything-that-has-changed-in-a-git-branch
Finding Everything That Has Changed in a Git Branch | LichtenBytes
December 21, 2021 - Go there for more information, as well as some alternatives. To get the list of files modified (and committed!) in the current branch you can use the shortest console command using standard git: git diff --name-only master...
🌐
Gcapes
gcapes.github.io › git-course › 02-local › index.html
Tracking changes with a local repository – Version control with Git
February 12, 2026 - If we save our commit message and exit the editor, Git will now commit our file. [master (root-commit) 21cfbde] 1 file changed, 2 insertions(+) Add title and authors create mode 100644 paper.md · This output shows the number of files changed and the number of lines inserted or deleted across ...
🌐
JetBrains
jetbrains.com › help › idea › investigate-changes.html
Investigate changes in Git repository | IntelliJ IDEA Documentation
May 27, 2026 - You can use the toolbar buttons ... fragment of source code or place the caret at the corresponding line. Choose Git | Current File ......