xxxxxxxxxx
git reset --hard <last_working_commit_id>
git push --force
xxxxxxxxxx
# Step 1: Clone the remote repository
git clone <remote_repository_url>
# Step 2: Move into the cloned repository's directory
cd <repository_directory>
# Step 3: List all commits to identify the commit to be removed
git log
# Step 4: Remove the commit using its hash
git push origin +<commit_hash>^:<branch_name>