remove initial commit git referencing new head
xxxxxxxxxx
git update-ref -d HEAD
xxxxxxxxxx
# Step 1: Identify the commit you want to remove
git log
# Step 2: Start an interactive rebase and mark the commit to be removed
git rebase -i HEAD~n
# Replace 'n' with the number of commits from the present branch head to the commit you want to remove.
# Step 3: In the interactive editor, delete the line corresponding to the commit you want to remove.
# Step 4: Save and exit the editor.
# Step 5: Force push the updated branch to the remote repository
git push origin <branch-name> --force