Git-tfs - 将遥控器重置为特定的sha

时间:2012-08-15 09:51:57

标签: git git-tfs

我正在使用git-tfs。

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

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

1 个答案:

答案 0 :(得分: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)