Software Engineering · Question 24 · Medium
Software Engineering question 24
You have uncommitted changes but must switch branches quickly to fix an urgent bug. Which git command temporarily shelves the changes so that you can restore them later?
- git reset --hard
- git stash
- git revert
- git clean -f
Answer and explanation
Answer: B. git stash
Explanation: git stash saves uncommitted changes on a stack and cleans the working directory; git stash pop restores them. reset --hard and clean -f would discard the work.
Previous: Which type of coupling between modules is considered the worst (strongest)? · Next: A bad commit has already been pushed to a shared main branch that teammates…
Practise software engineering
Try a fresh set of software engineering questions with an explanation after every answer, free and without signing up: Software Engineering practice. Or sit a full placement mock test.
More software engineering questions
- In software quality, which question does verification answer, as opposed to…
- What is the minimum number of test cases needed for 100% branch (decision)…
- Which type of coupling between modules is considered the worst (strongest)?
- A bad commit has already been pushed to a shared main branch that teammates…
- A Scrum team completed 30, 34 and 26 story points in its last three sprints…
- What is the cyclomatic complexity of this procedure?
- Using Basic COCOMO in organic mode, Effort = 2.4 × (KLOC)^1.05 person-months…
- In mutation testing, 50 mutants are generated. 5 of them are equivalent…
- Why should you avoid rebasing commits that have already been pushed to a…
More technical & programming practice
Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge