0

我正在使用 git-tfs。

如何将遥控器重置为特定的 sha?

我基本上想撤消对遥控器所做的更改。

4

1 回答 1

0

以下 git 命令使您能够恢复远程更改...

//reset your local index to the desired sha 
git reset --hard sha

//move the branch pointer back to the HEAD immediately preceding the HEAD at the desired SHA 
//The 'soft' means that the changes made between the HEAD-1 and HEAD at the desired SHA  are left in place and are visible as 'new' changes 
git reset --soft HEAD@{1}

git commit -m "Revert to sha"

git-tfs checkintool (or whatever syntax you use for pushing to the remote)
于 2012-08-15T10:41:58.930 回答