I have undone a local commit, all the files that were in this commit are now gone. Is there a way to revert the branch back to state when this undone commit was present?
Asked
Active
Viewed 320 times
0
-
Reset to the previous SHA? Revert? I'm not 100% sure I understand precisely what you're asking--it might be helpful to show the relevant command history and git feedback. – Dave Newton Apr 29 '21 at 17:26
-
would it help if I said it did reset --soft ba40bfd2d5a5a961add16.... – Michael.Medvedskiy Apr 29 '21 at 17:28
-
what I did is I pressed "Undo commit" in Git window, the git log shows reset --soft command, this is my problem - I want to revert this command – Michael.Medvedskiy Apr 29 '21 at 17:33
-
Once you do "Undo commit" you are prompted to choose a target changelist for these files. They shouldn't be deleted. Could you please check your Local Changes to see whether those files are listed there? – Ruslan Kuleshov Apr 30 '21 at 07:56
1 Answers
0
Intellij Undo commit uses git reset under the hood - this answer works wonders: How to undo 'git reset'?

Michael.Medvedskiy
- 247
- 5
- 8