[英]How can I roll back a Git repository and its remote?
I have a Git repo that I'd like to roll back by about a dozen commits using... 我有一个Git仓库,我想使用...回滚约12次提交。
git reset --hard d3289a7ab82fd76386d99bdd2c5e6496ecc62529
The problem is I've already pushed the commits to the remote. 问题是我已经将提交推送到远程了。
How can I return everything including the remote to the state it was in at the specified commit? 如何将包括远程在内的所有内容恢复为指定提交时的状态?
Reset locally, then force the push to Github – your remote and local will be in identical states: 在本地重置,然后强制推送到Github –您的远程和本地将处于相同状态:
git reset --hard d3289a7ab82fd76386d99bdd2c5e6496ecc62529
git push -f
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.