git revert HEAD?git revert HEAD in a repository where the last commit added a file named notes.txt. What will happen?git revert works compared to git reset.git revert HEAD creates a new commit that undoes the changes made in the last commit. It does not delete history but safely reverses changes.
git revert safer than git reset for undoing commits in shared repositories?git revert is preferred over git reset when working with others.git revert safely undoes changes by adding a new commit, so others' work is not disrupted. git reset rewrites history, which can cause problems if others have based work on those commits.
abc1234 without affecting other commits. Which command sequence is correct?git revert abc1234 creates a new commit that undoes changes from that commit only. Other options either reset history or target wrong commits.
git revert on a merge commit without any extra flags. What error message will Git show?Reverting a merge commit requires specifying the parent with -m option. Without it, Git cannot decide which side to revert.
Using git revert safely undoes changes by adding a new commit. Resetting or rebasing and force pushing rewrites history and can break others' work.
