CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE
What is the safest way to undo the effect of a single bad commit that is already on a shared branch other people have pulled?
- A. git revert <commit>, which creates a brand-new commit that reverses the change, without rewriting any existing history
- B. Manually editing the remote repository's files on the server
- C. Deleting the branch and recreating it from scratch
- D. git reset --hard and a force-push to erase the commit
Correct answer: A. git revert <commit>, which creates a brand-new commit that reverses the change, without rewriting any existing history
Revert adds a new commit undoing the change, which is safe for shared history since nothing that collaborators already have gets rewritten or removed.
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
- Which SDLC model is characterised by delivering the product in a series of small, usable, incrementally growing releases, each adding new…
- What is the key practical drawback of the waterfall model that iterative models (incremental, spiral, Agile) were designed to address?
- What is the difference between a mock and a stub in unit testing terminology?
- A build pipeline fails a merge if the newly added code's test coverage for that specific change falls below a configured threshold…
- In Kanban's 'cumulative flow diagram', a widening band for a particular stage over time most directly indicates:
- A control-flow graph has 22 edges, 16 nodes and 1 connected component. Using V(G) = E − N + 2P, what is its cyclomatic complexity?