I made some commits to git from android studio. Now I want to reset to one of the committed version. How can I do that within android studio?
Asked
Active
Viewed 1.1k times
7
-
Possible duplicate of [Revert Git repo to a previous commit](http://stackoverflow.com/questions/4114095/revert-git-repo-to-a-previous-commit) – Vucko May 07 '16 at 22:00
2 Answers
9
open terminal in android studio :
You can do this by following two commands:
git reset --hard [previous Commit SHA id here]
git push origin [branch Name] -f
It will remove your previous git commit.
If you want to keep your changes you can also use:
git reset --soft [previous Commit SHA id here]
Then it will save your changes.
For more details How do you undo the last commit?

Community
- 1
- 1

USKMobility
- 5,721
- 2
- 27
- 34