4 ms·
> Somebody merges something and pushes it to the master branch of the repo before it's ready. Now you want to pretend that never happened. Say 'abc123' is the
by justinmk 13y ago
> Somebody merges something and pushes it to the master branch of the repo before it's ready. Now you want to pretend that never happened.
Say 'abc123' is the commit immediately before the merge commit. Run this:
git rebase -i abc123
In the editor window that appears, delete the commit(s) that you want to "pretend never happened". Exit the editor. Git then replays the commits from abc123 up to HEAD, except without the commits you deleted. Now your local branch is in a state that omits the premature merge commit.
- steamer25 13y agoOr comparable to above, git reset --hard <previous commit's hash> and afterward you may have to git push --force ...to overwrite the changes in the blessed/central/public/shared repo.