简体   繁体   中英

Git-tfs - reset the remote to a specific sha

I am using git-tfs.

How can I reset the remote to a specific sha?

I essentially want to undo a change made to the remote.

The following git commands enable you revert a remote change...

//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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM