Comment

Comment by SubuSS

I think the steps under https://ohshitgit.com/#accidental-commit-master are wrong: it reverts the commit on the new branch -NOT on the master. This is because git branch auto checks out the new branch. You need to do

git branch NEWBRANCH

git checkout master

git revert —hard HEAD^

If you want to continue working on the new branch you do

git checkout NEWBRANCH

parent SubuSS 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton