使用SourceTree将远程仓库回滚到某一次提交
原理:在本地需要回滚的commit上创建一个分支,将该分支合并到远程仓库。
步骤
1、在需要回滚的commit上右键创建分支
![](http://upload-images.jianshu.io/upload_images/811359-7e869844c4cfa718.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
创建分支
2、输入新的分支名
![](http://upload-images.jianshu.io/upload_images/811359-e1d75d059d41db3a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
命名分支
3、左侧出现了新的分支。
![](http://upload-images.jianshu.io/upload_images/811359-088ce252a40bbb2a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
切换分支
4、点击工具栏上的推送
![](http://upload-images.jianshu.io/upload_images/811359-3f200db8131dd8a4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
推送
5、选择远程分支为待合并的分支,这里选择master
![](http://upload-images.jianshu.io/upload_images/811359-be0f507012f36a1c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
推送分支
6、在SourceTree出现了新的回滚
参考链接:
1.http://www.jianshu.com/p/3faabf43991c