Reputation: 67
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
Upvotes: 1
Views: 97
Reputation: 61
you can use this following command -
git checkout commitIdOfPreviousCommit path/to/file.txt
Upvotes: 0
Reputation: 2023
If you are using Android Studio then It will be lot easier to you. Just follow These Steps
ctrl + alt + z
.this is example image when I pressed ctrl + alt + z
Upvotes: 1