3

I've accidently did git commit --amend on the last commit on the tree (which is not written by me ) and I would like to undo this commit and retrieve my changes back to the working directory.

I'm familiar with the fact the --commit amend is part of "Rewriting History" Git commands but I hope there is a workaround via author name or any other.

0

1 Answer 1

2

Yes, there is a way to recover your state prior to the amend. Go to the working copy and run git reflog, find the hash of the commit prior to the amend and do a git reset to it. You are done ;)

Duplicate of: How to undo "git commit --amend" done instead of "git commit"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.