git diff @{push}

Compare your working directory to the commit recorded at your last push

This command helps you see all local changes since your last push by diffing against the HEAD@{push} reflog entry.

It invokes git diff with a single argument, the @{push} selector (shorthand for HEAD@{push}), which tells Git to compare that saved commit to your current files; you can also append flags like --stat for a summary view, -p (alias for --patch) for full diffs, or --name-only to list just the changed file names.

You can swap @{push} for other reflog selectors such as HEAD@{1} (previous HEAD) or HEAD@{yesterday}, compare against upstream with git diff @{u}, or point at branches and remotes like git diff origin/main; complementary tools include git status for a quick overview and git difftool for interactive diffing.

Related commands

Welcome to GitExamples!

Sign in to enable bookmarking, reminders, progress-tracking and more...