撤销Git提交

6

我试图更改Git的本地代码编辑器,但未成功。现在,每次我尝试还原提交时,都会收到以下错误:

hint: Waiting for your editor to close the file... notepad++.exe -wl1: notepad++.exe: command not found
error: There was a problem with the editor 'notepad++.exe -wl1'.
Please supply the message using either -m or -F option.

我想知道如何重置或删除我所尝试的修改。


那么你的问题是关于还原提交(Git中非常具体的一件事,使用git revert命令),还是关于更新配置设置?如果是后者,请参见https://stackoverflow.com/q/6459506/1256452。 - torek
2个回答

8

1
非常感谢您! - Theodore Steiner

0

只需在您的~/.gitconfigC:\Users\<user>\.gitconfig)中的[core]部分找到并修复一个editor设置。


但是我该如何从命令行中删除我所输入的条目,并将其恢复为默认值,就像我没有尝试更改任何内容一样? - Theodore Steiner
你可以用你喜欢的编辑器打开那个文件,然后简单地删除这些行。 - madhead

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接