5

PyCharm allows a user to diff any two files in the project, or to diff any file with previous Git commits. Is there a way to diff a file with its version in the stash?

Of course, this is possible from the command line with Git, but I would like to do it with IntelliJ's graphical editor.

Josiah Yoder
  • 3,321
  • 4
  • 40
  • 58

1 Answers1

8

In IntelliJ you can call VCS - Git - Unstash, select the stash you want to see and click View. This will list all files modified by the stash. From there you can invoke individual diffs

Note that diffs opened this way will show you the actual diff between the stashed version and your local code (equivalent of git diff stash@{0}) while git stash show -p suggested in the mentioned thread shows only the stashed patch.

Dmitrii Smirnov
  • 7,073
  • 1
  • 19
  • 29
  • The VCS is in the main menu, not the right-click menu. The Unstash option is called "UnStash Changes..." in my version of PyCharm. – Josiah Yoder Sep 12 '19 at 13:55
  • I like that it allows comparing with my local copy rather than the commit on which the stash was based. I think this is usually more useful for me. – Josiah Yoder Sep 12 '19 at 13:56