1. 检查想要放弃的commit id
git log
2. 取消commit
# 取消commit,取消add
git reset <commit id>
# 仅取消commit
git reset --soft <commit id>
# 什么都不保留(慎用)
git reset --hard <commit id>
1. 检查想要放弃的commit id
git log
2. 取消commit
# 取消commit,取消add
git reset <commit id>
# 仅取消commit
git reset --soft <commit id>
# 什么都不保留(慎用)
git reset --hard <commit id>
本文标题:【CMD】 放弃没有push的commit
本文链接:https://www.haomeiwen.com/subject/xgkeedtx.html
网友评论