1. 查看最近的提交记录
git log git show +hashid
2. git reset --hard + hashid
3. git push HEAD orgin --force
4. 如果上次提交的内容有误,想进行修改,而且不想进行新的提交,使用git commit – amend。
步骤:
1.修正内容,执行“git add”;
2.执行“git commit --amend”;
3.自动进入vim提示需要添加commit信息。输入:“i”添加信息"delete fff",“esc”、“wq”退出并保存;
4.执行“git push -f”成功推送到服务器 (git push会提示报错:当前暂存区版本低于服务器版本一次提交)。