git有著各式各用的GUI工具可以使用,但有時候對於工具不常使用的功能,就需要摸索
有時候開發時,會出現想要取消Commit的情況(Reset),或是退回到某個時間點(Revert)
此時就需要一些操作,但因為自己也鮮少使用,網路上也沒有相關正確操作,所以來做一篇reset實作
環境
- TortoiseGit
- GitLab
首先做一個專案,並建立三次的推送

可以在GitLab上看到確實也有相同的推送情況

選第二次推送的紀錄,並使用右鍵,點選Reset

將Reset Type 選為Hard

重新Push,並在Options上勾選force(強制)

GitLab上的紀錄就會更改為兩筆