Search code examples
gitgit-diff

Is it possible compare staged and stashed versions of files in git?


Some times ago I stashed files. Now I stage some.

Is there a way to compare those versions of files?


Solution

  • You can use:

    git diff --cached stash@{n} -- file
    

    where n corresponds to the stash number of the stash you wish to diff against.