git 回退到上一个版本 committer does not match your user account.

问题:

git提交到远程提示:committer does not match your user account.

原因:

你本地的账号和远程的账号不一致导致该错误

解决办法:

push提示该错误,所以你已经ci到了本地,需要解决需要3步
1. 修改新账户,我一般都是改的global
修改邮箱:git config –global user.email xxx
修改用户:git config –global user.name xxx
2. 回退上一个提交版本
git reset --soft HEAD^1 //回退到上一个版本,add出
3. 用新账户重新add,ci,push

注
不要用 git reset --hard logid 这样回退不到add之前
出现该错误,核心就是修改账户,并将ci之后的代码回退到add之前,用新账户重新提交
https://www.cnblogs.com/lyy-2016/p/6509707.html

你可能感兴趣的:(git)