应用更改后,可以通过运行 `git status` 命令来检查代码的状态。确认代码已经还原到了撤销前的状态后,可以使用 `git commit` 命令提交还原的更改。例如: “` $ git commit -m “Revert revert commit a123456” “` 提交成功后,代码就会还原到撤销之前的状态。 总结起来,还原 `git revert` 的方法可以用以下几...
With this option,git revertwill let you edit the commit message prior to committing the revert. This is the default if you run the command from a terminal. -m parent-number --mainline parent-number Usually you cannot revert a merge because you do not know which side of the merge should ...
This option will open the configured system editor and prompts you to edit the commit message prior to committing the revert --no-edit This is the inverse of the -e option. The revert will not open the editor. -n --no-commit Passing this option will prevent git revert from creating a ...
With this option,git revertwill let you edit the commit message prior to committing the revert. This is the default if you run the command from a terminal. -m parent-number --mainline parent-number Usually you cannot revert a merge because you do not know which side of the merge should ...
2.根据提交的commit,撤销某次具体的commit(注意切换分支至目标分支): 1 git revert 94d26b9c189497c6cda72dffb0c9afee6cb8fb96 3.撤销本地merge(原文链接:Undo a Git merge that hasn't been pushed yet) Withgit reflogcheck which commit is one prior the merge (git reflogwill be a better option th...
2.根据提交的commit,撤销某次具体的commit(注意切换分支至目标分支): git revert 94d26b9c189497c6cda72dffb0c9afee6cb8fb96 1. 3.撤销本地merge With git reflog check which commit is one prior the merge (git reflog will be a better option than git ...
For a pushed commit, use one of these strategies: Create and push another commit that fixes the issues caused by the prior commit. Undo the prior commit that was pushed, by using git revert to create a new commit that reverts all changes made by the prior commit. Then push the new ...
git commitcommand captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to. Prior to the execution ofgit commit, thegit addcommand is used to promote or...
support an--amendflag which instructs git to replace the HEAD commit with a new one, based on the current contents of the index. This gives you an opportunity to add files that you forgot to add or correct typos in a commit message, prior to pushing the change out for the world to ...
Every time you perform a commit, you’re recording a snapshot of your project that you can revert to or compare to later. — Pro Git Book,(1) This article is about effective commit messages using the Git version control system. Git is one of the topsource control managementtools. If yo...