Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.4k points)
edited by
I'd like to know if it is possible to extract a single file or diff of a file from a git stash without popping the stash changeset off.

Might anyone be able to provide some suggestions/ideas about this?

1 Answer

0 votes
by (27.5k points)

Use the following command:

$ git checkout stash@{0} -- <filename>

Things to remember: 

A. Make sure that you put a space between the "--" and the file name parameter

B. Replace zero(0) with your specific stash number. 

In order to see the stash list, use the following command:

$ git stash list

Related questions

+1 vote
1 answer
+9 votes
2 answers
+6 votes
2 answers
0 votes
1 answer
asked Aug 2, 2019 in DevOps and Agile by Han Zhyang (19.7k points)

Browse Categories