【GIT】彻底删除一个提交
2022-07-11 本文已影响0人
盐果儿
有时候会提交本地一些不想提交的内容,像密码和日志之类的,这时候我们想要删除这个提交。
1. 查看提交记录,找到不想要的提交的上一个提交的commit hash
git log
2. 强制删除提交
git reset --hard [commit hash]
3. 推送到远程仓库
git push [branch name] --force
Reference:
https://blog.csdn.net/weixin_42089190/article/details/116975087