I have git woes, /g/
Today I accidentally merged my dev branch into master branch via messy hotfix acrobatics. Not content with this initial idiocy, I pushed the master branch to origin, then realised what had happened.
Is there a way to undo the merge and have the change reflected on the origin repo as well?
git reset --hard?
Check merge's id with "git log"
Then git revert
>>51423006
revlog fuckery
I've read the git book back to back and a few tutorials and I still don't fully understand it. I might dive into a random project just to learn more about git; using it for my own stupid shit just feels silly and I like I'm not learning anything.
>>51423006
Git reflog, git reset, git push - f
Checkout the last proper commit on master and then force push that to origin, erasing the history of your disaster. If for some reason you want to preserve your screw up in history, just revert the merge commit.
>>51423948
Tried it, didn't work
>>51423999
Tried this too :(
>>51424009
Do you mean reflog?
>>51424051
Does git-reset require any flags or is the command literally as you described it?
Also does this still work if there's no current MERGE-HEAD? I'm on a different machine currently, just seeing what I can do with clones of the origin repo.
Cheers all for the advice.
>>51424089
How do I check out a specific commit?
>>51424723
Looks like Chewbacca
>>51424686
git checkout SHAOFCOMMIT
Poor dog 3:
>>51424686
so you'll probably want to do
git checkout sha123456123
git push -f origin branch_name
but, you dumb faggot, make sure you take current master and do
git checkout -b master_copy and push that shit somewhere so that you have a back up in case you fuck more things up
>>51425362
>>51425389
Great, thanks guy(s?)
You should learn properly how git works.
Trying to use git just as you would use svn or mercurial is just fighting against the tool.
Believe me, learn how it works, it's not that hard and time used learning how to use your tools is not time wasted.
I learned mainly with this video :
https://www.youtube.com/watch?v=8dhZ9BXQgc4
>>51426673
Yeah, I've been in the habit of just using the bits I need at any given time. I'll do this.