Home > Net >  How can I get last committed code in particular file in git bash
How can I get last committed code in particular file in git bash

Time:10-01

I am working in android and I have a file named MainActivity.class and I am init that project by using gitbash and I want to get the previous code of MainActivity.class

If I tried this then it will rollback all files to the previous code but I don't want that:

git checkout -f

CodePudding user response:

If you are using Android Studio then It will be lot easier to you. Just follow These Steps

  1. In left side of your android studio editor you got a commit panel.
  2. Right Click on that then click on the file you want to rollback
  3. You got a option named Rollback click
  4. Then you will see a dialog then choose your file then click rollback.
  • Related