Git消除最近的几个commit
2019-05-03 本文已影响0人
蝌蚪1573
使用命令git log --graph
查看commit信息

如果上图框出来的commit不想要了,要恢复到ID为39425e92的commit(要恢复到哪个commit就取哪个ID);则直接使用命令
git reset --hard 39425e92
就行了注意 因为这个命令只会保留到恢复的那个commit,之后的commit都会被清空,慎用!!!
使用命令git log --graph
查看commit信息
git reset --hard 39425e92
就行了