Let's say I forgot to commit at the moment of compiling my APK. I continued modifying my files, and then committed later on. Can I go back to the precise moment of APK compilation, which is unfortunately between two commits?
Asked
Active
Viewed 30 times
1 Answers
0
No, you can't do it - some things you can do is either go back to your old commits and start again(not recommended)or:
If the change was not so large you can see what exactly did you changed and start hard copy-pasting and return to your old version of the code.
But the best thing I can recommend is to use branches - start a production branch(only stable code goes there) and dev branch(in this branch you can modify your code as you want because you have another stable working branch)
Edit: as Zoe mentioned in one of the comments - check for local history in your IDE (the link gives example for android studio IDE)

Tamir Abutbul
- 7,301
- 7
- 25
- 53
-
Thanks. I try to use branches as much as I can, but I guess I had a moment of devious behaviour, and now I regret it :s – Myoch Mar 07 '19 at 22:21
-
branches can really save you a lot of time, and if my answer helped you please accept it so others with the same problem can know that this can help them too. – Tamir Abutbul Mar 07 '19 at 22:22
-
1Local History might help. – Zoe Mar 07 '19 at 22:36
-
Local history is a really good solution, in my answer I only mentioned the history working with git and forgot about the fact that a lot of IDE have local history saved - i will edit my answer, thank you – Tamir Abutbul Mar 07 '19 at 22:44