This gonna be a solution for you whenever you wanna rollback commit HEAD on repo GIT to specific point commit reflog
just because you wrongly push some code and don't wanna make it dirty on repo. Or your client doesn't pay you after you've work. You can use this method.
This method gonna delete histories commit after you revert / rollback to specific point of commit. Or you can say this is a HARD RESET
- get the log historis of commit you've already pushed on repo with command
git reflog
- something like
155b09b HEAD{3}: commit message here
gonna shown, on most left side you gonna see code commit - choose one to where you wanna revert histories
- use this command,
git reset --hard <commit-id>
- then type
git push -f <origin or others> <branch master or others>
- done and see yourself