Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git意外覆盖_Git_Github - Fatal编程技术网

Git意外覆盖

Git意外覆盖,git,github,Git,Github,我从计算机A推送了一些对我的回购协议的更改,然后意外地从计算机B推送了旧的状态。如何从计算机A恢复到版本(我不知道要恢复到的版本的代码) 由于找不到任何帮助,请帮助或标记原始问题。使用cmdgit log检查提交/diff,然后根据提交推送 git reset --hard <old-commit-id> git push -f <remote-name> <branch-name> git重置——硬 git-push-f 从日志中查找上一次提交,然后根据历

我从计算机A推送了一些对我的回购协议的更改,然后意外地从计算机B推送了旧的状态。如何从计算机A恢复到版本(我不知道要恢复到的版本的代码)


由于找不到任何帮助,请帮助或标记原始问题。

使用cmdgit log检查提交/diff,然后根据提交推送

git reset --hard <old-commit-id>
git push -f <remote-name> <branch-name>
git重置——硬
git-push-f

从日志中查找上一次提交,然后根据历史记录推送

git log
git reset --hard <id>
git push -f <remote-name> <branch-name>
git日志
git重置——硬
git-push-f

我找不到我需要的版本。你知道提交消息或任何与系统推送有关的信息吗?我知道提交消息查找提交id请遵循上述步骤。git log--name status请更具体一点-你在计算机A上还有状态吗?你还能用电脑吗?是用力推的吗?在你离开计算机B之前,你有没有把它拉进去?“还原”的字面意思是“git还原”还是不一定?