How to revert project back to a previous commit in android studio

后端 未结 6 1828
春和景丽
春和景丽 2021-01-31 07:11

I am working on a project in android studio and would like to revert to a previous push. I attempted
VCS => Git => Reset Head (Hard)
but my project in Android Studio is

相关标签:
6条回答
  • 2021-01-31 07:49

    Open the Version Control Panel using alt + 9 and click on Log. This should show a list of commits. Right click on the commit you want to revert to and select Reset Current Branch to Here. This should bring up a list of options to keep or discard changes when reverting. Select Hard to discard any current changes and click Reset.

    0 讨论(0)
  • 2021-01-31 08:00
    1. In android studio 4.0, go to version control -> Log.
    2. Then select the commit you want to revert to.
    3. Choose Reset current branch to here.
    4. You ll see a popup, select Hard and its done.
    0 讨论(0)
  • 2021-01-31 08:03

    The icon surrounded by red rectangle in image will do the trick

    0 讨论(0)
  • 2021-01-31 08:08

    Android Studio -> Version Control -> Select your commit -> Right panel -> Select you want to be reverted file.

    Then you can get the new reverted change, commit -> done.

    0 讨论(0)
  • 2021-01-31 08:08

    Right click on folder where you Github folder, press Git Bash Here and type git reset --hard

    0 讨论(0)
  • 2021-01-31 08:12

    Android Studio Instructions: if you want to do this in Android Studio, press alt + 9 (or Command + 9 on Mac) to open the Version Control panel. Switch to the Log tab and right click on a previous commit. Select Checkout Revision.


    Command line instructions: Open the command line tool you are using. Go to the Android app's Git directory (using cd). Execute git log and find the previous commit you want to revert to.

    commit 7c247be6d8975dc88f6cc2631c154786a1f3b79e
    Author: John Doe <john@doe.ca>
    Date:   Fri Jun 11 22:37:35 2015 -0400
    
        Some helpful commit message should be here.
    

    If that is the commit you want to revert to, then execute git checkout 7c247b.

    0 讨论(0)
提交回复
热议问题