commit錯branch點算?

本來一直係master做緊, 前幾個commit開左個branch做野
第二個係我commit的, 係正確地commit左去個branch到
但點知我同事commit錯左, commit左去master(第一個) (我睇畫面係咁理解, 估佢commit錯左)
而家要點做?
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

>>>而家要點做?
roll back commit

TOP

https://github.com/blog/2019-how-to-undo-almost-anything-with-git

Undo a "public" change

Scenario: You just ran git push, sending your changes to GitHub, now you realize there's a problem with one of those commits. You'd like to undo that commit.

Undo with: git revert <SHA>

What's happening: git revert will create a new commit that's the opposite (or inverse) of the given SHA. If the old commit is "matter", the new commit is "anti-matter"—anything removed in the old commit will be added in the new commit and anything added in the old commit will be removed in the new commit.

This is Git's safest, most basic "undo" scenario, because it doesn't alter history—so you can now git push the new "inverse" commit to undo your mistaken commit.

TOP

Undo a "public" change

Scenario: You just ran git push, sending your changes to GitHub, now you r ...
goofyz 發表於 2015-7-20 14:13



係我部機做都得嗎?
同埋係revert去第一個item定係無四個item? 照篇文講, 我應該revert去無問題果個commit, 咁即係第四個item?

TOP

係你部機都做得 (前提當然係你地溝通好啦),
revert 番你認為正確 o個個, 我估都係第4個掛...

TOP