Interview Prep/Git & GitHub/Undoing changes: reset, revert, restore and reflog

How do you view the contents of a stash?

IntermediateConceptUndoing changes: reset, revert, restore and reflog
Answer

git stash show gives a diffstat, -p the patch. A stash is a commit with up to three parents (HEAD, index, untracked) so you can also git show stash@{1}.

git stash show -p stash@{1}
git diff stash@{0}^1 stash@{0}
All Git & GitHub questions Roadmap: Git & GitHub

More on Undoing changes: reset, revert, restore and reflog