How to undo “git commit --amend” done instead of “git commit”

483    Asked by AnneBell in SQL Server , Asked on Jun 20, 2021

 I accidentally amended my previous commit. The commit should have been separate to keep a history of the changes I made to a particular file.

Is there a way to undo git commit amend? If I do something like git reset --hard HEAD^, the first commit also is undone.

Answered by Abigail Abraham

Your Answer

Interviews

Parent Categories