30

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
  • 18,150
  • 39
  • 158
  • 271

2 Answers2

40

You can use the diff command with a path:

git diff stash@{1} -- <path>
sergej
  • 17,147
  • 6
  • 52
  • 89
-3

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
  • 4,300
  • 1
  • 12
  • 27