Undo the Merge
The latest commit on main is the merge of feature. It broke things, and others already have it, so the history has to stay. Undo everything the merge brought in with one new commit, with the message Git suggests.
Example 1
starts as
* d053abf (HEAD -> main) Merge branch 'feature' |\ | * d600d65 (feature) add g | * 5f6b5ac add f * | 76eccdb add b |/ * b527f18 first commit nothing to commit
ends as
commits, newest first: Revert "Merge branch 'feature'" Merge branch 'feature' (a merge) add g add f add b first commit files in the latest commit: a.txt b.txt staged: nothing changed, not staged: nothing untracked: nothing
Constraints
featurehad 1 to 3 commits, each adding a file- Nothing is edited or staged
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Git problems
- When Was It AddedHard
- A New BranchBeginner
- Back to MainBeginner
- Commit the ChangeBeginner
- Commit the New FileBeginner
- How Many CommitsBeginner
- Stage One FileBeginner
- Start a RepositoryBeginner