【发布时间】:2016-05-07 15:23:37
【问题描述】:
我从 android studio 对 git 做了一些提交。现在我想重置为已提交的版本之一。我怎样才能在 android studio 中做到这一点?
【问题讨论】:
标签: android git android-studio
我从 android studio 对 git 做了一些提交。现在我想重置为已提交的版本之一。我怎样才能在 android studio 中做到这一点?
【问题讨论】:
标签: android git android-studio
在 android studio 中打开终端:
您可以通过以下两个命令来做到这一点:
git reset --hard [previous Commit SHA id here]
git push origin [branch Name] -f
它将删除您之前的 git 提交。
如果您想保留更改,也可以使用:
git reset --soft [previous Commit SHA id here]
然后它将保存您的更改。
【讨论】: