I have a checkout copy of a remote git repository in my workstation. I have accidentally committed a change in my local and pushed to remote. Now I want to remove the last commi
I'd advise against pushing with --force an alternative history. Anyone who already pulled your changes will have a completely screwed history to deal with when pulling new stuff.
A far safer option is to simply do
git revert HEAD~1
git push origin master
git revert will record a new commit that cancels all of the effects of the previous one