1
0
mirror of https://github.com/k88hudson/git-flight-rules.git synced 2025-06-17 05:21:35 -03:00

Update reflog shortname with an ancestry reference (#345)

This commit is contained in:
apastan
2023-02-01 05:17:10 +03:00
committed by GitHub
parent 18c656604b
commit 3ff35c8642
9 changed files with 9 additions and 15 deletions

View File

@ -163,8 +163,7 @@ $ git push -f [remote] [branch]
如果你還沒有推送到遠端重設reset到你最後一次提交前的狀態就可以了同時保存暫存的變化
```
(my-branch*)$ git reset --soft HEAD@{1}
(my-branch)$ git reset --soft HEAD^
```
這只能在推送之前使用。如果你已經推送了,唯一安全的做法是 `git revert SHAofBadCommit`那會創建一個新的提交commit來撤消前一個提交的所有變化changes或者如果這個分支是 rebase-safe 的(例如:其他開發者不會從這個分支拉取),只需要使用 `git push -f`;參見[上一節](#deleteremove-last-pushed-commit)。