Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo git command - reset head (hard) in android studio

i reset my head to a few commits back in android studio and chose reset type as hard. I lost a weeks work. Is there any hope to undo this ? I am using android studio and it has GUI built in options to do all git related functions so i never used git bash (or whatever terminal is used for git). There is a solution here but it used terminal so i asked again if anyone knows how to do it using android studio itself.

like image 250
Shreyans Avatar asked May 28 '26 18:05

Shreyans


1 Answers

It's likely that you can use Android Studio's Local History to restore the changes. Right click the root directory of your project, select Local History | Show History... from the menu. In the history, you'll find an "External change" entry corresponding to the 'git reset' command that you performed. You can select the entry below that and press the "Revert" button.

like image 88
yole Avatar answered May 30 '26 08:05

yole