CS FundamentalsModerateWipro NLTH · Cognizant GenC
After committing by mistake, a developer runs git reset --soft HEAD~1. What is the result?
- A. The last commit is removed and its changes are left unstaged in the working tree
- B. The last commit is removed from history but its changes stay staged
- C. The last commit and all of its changes are discarded
- D. A new commit that reverses the last commit is created
Correct answer: B. The last commit is removed from history but its changes stay staged
--soft moves the branch pointer back only; index and working tree are untouched. --mixed would unstage, --hard would discard, and revert makes a new commit.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A field accepts ages from 18 to 60 inclusive. Which set of test values best applies boundary value analysis?
- In Scrum, who is accountable for ordering the items in the Product Backlog?
- The question "Are we building the right product?" is answered by which activity?
- Which of the following is a typical example of Platform as a Service (PaaS)?
- A class has methods to calculate employee salary, save the employee to a database and print a payslip report. Which SOLID principle does…
- Which situation in Git definitely produces a merge conflict?