You can do below to undo your “git commit —amend”git commit —amend
- $ git reset --soft HEAD^
git reset --soft HEAD^ - $ git checkout files_from_old_commit_on_branch
git checkout files_from_old_commit_on_branch - $ git pull origin your_branch_name
git pull origin your_branch_name
====================================
Now your changes are as per previous. So you are done with the undo for “git commit —amend” Nowgit commit —amend
Now you can do “git push origin <your_branch_name> “git push origin <your_branch_name>, to push to the branch.