You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Step 1: Switch to the develop branch
git checkout develop
# Step 2: Pull the latest changes from the main branch
git pull origin main
# Step 3: Reset the develop branch to match the main branch
git reset --hard origin/main
# Step 4: Force push the changes to the remote repository
git push origin develop --force
echo"Develop branch has been overwritten with the content of the main branch."
Save current main and revert to older commit while keeping history
# 1. Create a backup branch with the current state
git checkout -b backup-main
# 2. Switch back to master
git checkout master
# 3. Revert all commits after 2b7ef015 but don't commit yet
git revert --no-commit 2b7ef015..HEAD
# 4. Commit the revert as a single commit
git commit -m "Revert codebase to state of commit 2b7ef015 while preserving history"
# 5. Push changes to origin
git push origin master