QuestionQ41

VerifiedSoftware Development and Design

Which command reverses the most recent commit while leaving the index file and working tree position unchanged?

Explanation

git reset --soft HEAD^ moves HEAD to the parent of the current commit while leaving both the index and working-tree files unchanged. The changes from the removed commit therefore remain staged.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!