如何在 SmartGit/Git 中撤销提交操作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38202868/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to undo commit operation in SmartGit/Git
提问by Mahesh Gulve
Want to undo commit operation in smart git. Accidently commited wrong code and now unable to recover that code.
想要在智能 git 中撤消提交操作。不小心提交了错误的代码,现在无法恢复该代码。
Thanks in advance.
提前致谢。
回答by mstrap
In SmartGit, just invoke Local|Undo Last Commit; this will put your changes back to the Index. Now you may revert them partially or all together using Local|Discard.
在 SmartGit 中,只需调用Local|Undo Last Commit;这会将您的更改放回索引。现在您可以使用Local|Discard部分或全部还原它们。
回答by Vampire
The actual commit
command can be undone by git reset --soft @~
commit
可以通过以下方式撤消实际命令git reset --soft @~
回答by Didi
please watch this topic : smartgit delete commit and return to previous commit
请观看此主题:smartgit 删除提交并返回上一次提交
as the answer said, it's not specific to smartgit but git in general. You just have to rollback to the previous commit, create another branch and work on it !
正如答案所说,它不是特定于 smartgit,而是一般的 git。你只需要回滚到之前的提交,创建另一个分支并处理它!
Be careful with your following commits :)
小心你的以下提交:)