CS FundamentalsVery hardInfosys · Cognizant GenC
Commits A-B-C-D-E are on the shared main branch and already pushed. Commit C introduced a bug. What is the safest way to undo only C's effect?
- A. git reset --hard B and force-push
- B. git rebase to delete C and force-push
- C. git revert C, creating a new commit that reverses C
- D. git checkout B and commit there
Correct answer: C. git revert C, creating a new commit that reverses C
Revert adds a new commit that cancels C without rewriting shared history, so D and E remain and collaborators are unaffected.
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 module contains functions to print to screen, write to a file and send over a network; a flag argument decides which one runs. Which…
- A load balancer with 99.9% availability fronts two redundant servers (parallel), each with 90% availability. System works if the balancer…
- A mutation test run generated 40 mutants. 4 are equivalent mutants and 28 were killed. What is the mutation score, excluding equivalent…
- Branch main has commit A. Branch feature was created from A and has commits B and C. After git merge --no-ff feature on main, how many…
- An object wraps another object that implements the same interface, adding behaviour dynamically before or after delegating (as…
- Module A calls B and C; B calls D and E; C calls F. In top-down integration testing with depth-first ordering, in which order are modules…