What left me wondering is why the master wasn't protected!?
Anyway, git-revert is super helpful in such incidences, it mutates the branch history though. But it makes sure you don't lose your changes under any incident. If you feel like you lost your changes, you can always go back to the reverted commit, checkout a branch from there and continue.
What i'd suggest in such scenario is,
git branch newBranch: Create a new branch keeping the accedental commit, that'll preserve your development and the code so far.
git reset --hard <commit hash> (on master). That'll leave the master unmutated.
Now switch to newBranch and continue with your business like nothing ever happened!
What left me wondering is why the master wasn't protected!?
Anyway, git-revert is super helpful in such incidences, it mutates the branch history though. But it makes sure you don't lose your changes under any incident. If you feel like you lost your changes, you can always go back to the reverted commit, checkout a branch from there and continue.
What i'd suggest in such scenario is,
git branch newBranch
: Create a new branch keeping the accedental commit, that'll preserve your development and the code so far.git reset --hard <commit hash>
(on master). That'll leave the master unmutated.Now switch to newBranch and continue with your business like nothing ever happened!
Wouldn't protecting a branch only affect the remote repo? I don't think she pushed to master.