如何重置为我在Android Studio中的上次提交 [英] How to reset to my last commit in Android Studio
问题描述
我对Android Studio中的git进行了更改,之后,我对项目进行了一些更改,这些更改会给我带来错误,现在我想找回没有错误的已提交版本。
我该怎么做?
I commit changes to git from Android Studio, after that i have made some changes in my project that gives me errors, and now I want to get back that commited version that has no errors. How can I do that?
推荐答案
撤销最新的更改并重置为最近的提交:
To undo your latest changes and reset to the most recent commit:
转至 VCS - > Git - >重置HEAD ..
更改 >重置类型为 hard
以移除这些更改。
Change Reset type to hard
to remove those changes.
它看起来像这样。你可以在你做之前验证重置。
It will look like this. You can validate the reset before you do it if you want.
如果您点击验证 ?
将弹出一个屏幕,显示您要重置的提交中所做的更改。您可以查看每个文件的差异,以显示该文件中提交的内容。它或多或少与终端中的 $ git show
相同。
与我之前所设想的相反,不显示执行重置时会影响哪些文件。
Contrary to what I assumed before, it does not show what files will be affected when you perform the reset.
这篇关于如何重置为我在Android Studio中的上次提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!