Skip to content
CodeKruPro

Set aside unfinished work with git stash

QuizEasy-MediumAsked in: Accenture, Capgemini, TCS, Wipro

You have edited CartTest.java (a tracked file) and created a new file notes.txt. You run git stash. What happens?

  • The change to CartTest.java is stashed and the file is clean again; notes.txt stays in the folder because untracked files are not stashed unless you use git stash -u
  • Both files are stashed
  • Both changes are deleted for good
  • The changes are committed to the current branch

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in