如何撤消几个Git命令?

时间:2016-03-19 18:00:53

标签: git undo rm

有机会撤消以下任何一行:

git rm cvs
git rm cvs -r
git reset HEAD --.
git reset --hard HEAD
git reset --hard
git clean -df
git status
git rm --cached .
git rm --cached
git rm --cached -r
git rm --cached -r --ignore-unmatch
git rm --cached -r --ignore-unmatch .

1 个答案:

答案 0 :(得分:0)

要撤消上次已知良好提交的特定提交,请首先查看 <script> function validation() { if (window.confirm("Click OK if you have entered Anthropometric Data")){ window.location.replace = "send_PhysiologicalMeasures.html"; } } </script> ,您应该在shell中看到这一点:

git log

您应该复制commit: your40characterSHA1codehere # copy this into the clipboard Author: your name here with email address date: date-here Commit message here 代码,然后执行commit sha1git reset --hard your40characterSHA1codehere以强制推送您处理的主分支机构或其他分支机构。希望这有帮助!