Interview Q&A / Git & GitHub

INTERVIEW Q&A · 97 QUESTIONS

Git & GitHub interview questions

Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.

  1. How do you undo a commit that you already pushed to a shared branch?

    Use git revert, which adds a new commit that cancels the bad one. History is not rewritten, so teammates can pull normally. Avoid reset plus force-push on shared branches.

    BeginnerQuick answer1 min read