21

I know from this answer how to show the diff against a stash.

git stash show -p stash@{1}

But how can I show the diff to a specific file from a stash?

Black
  • 15,426
  • 32
  • 140
  • 232

2 Answers2

29

You can use the diff command with a path:

git diff stash@{1} -- <path>
sergej
  • 15,727
  • 6
  • 44
  • 82
-2

Ru following commands:

  1. git stash list

    This will return the stash list like

    stash@{0}: WIP on registration_branch: c50163e Error handlers added.

    stash@{1}: WIP on registration_branch: c50163e Error handlers added.

  2. git diff stash@{0}

    It will return git differences for stash@{0}

Umar Hayat
  • 3,160
  • 1
  • 8
  • 23