Reputation: 656
Here are the steps that have led to the issue:
And now, how do i add these changes to the previous commit without having to resolve the merge conflict.
I am hesitant in trying to git reset HEAD~
so that i don't lose the changes. it has been a long resolution.
will a git reset HEAD~
work?
Upvotes: 0
Views: 323
Reputation: 37722
git add <your-files>
git commit --amend --no-edit
or in a single command:
git commit -a --amend --no-edit
the flags:
-a
: commit all unstaged and staged changes (no need for git add
)--amend
: put the changes in the previous commit--no-edit
: and keep the commit message as it waswill a git reset HEAD~ work?
Yes, that is another but longer option, but gives the same result:
git reset HEAD~ # undo last commit
git add <your-files>
git commit -m "message"
Upvotes: 4