zilcuanu
zilcuanu

Reputation: 3715

difference between soft reset and amend commit in git

I am learning git and came across git soft reset and amending a commit in git. I see both of them serving the same purpose. Any notable difference between the two. Please let me know since I am not able to see any difference between the two.

Upvotes: 4

Views: 1109

Answers (1)

Taelsin
Taelsin

Reputation: 1090

git commit --amend will change your most recent commit on the current branch by adding any staged changes you've made so far to it and prompt you to change the commit message.

git reset --soft will actually remove commits from the current branch but keep the changes as uncommitted changes that need to be staged and recommitted.

Upvotes: 8

Related Questions