Skip to content

Instantly share code, notes, and snippets.

@HanjoStudy
Created September 20, 2023 13:23
Show Gist options
  • Save HanjoStudy/866cbdcee74cb7009695090063a62206 to your computer and use it in GitHub Desktop.
Save HanjoStudy/866cbdcee74cb7009695090063a62206 to your computer and use it in GitHub Desktop.
Github reset before prod
# Create a new orphan branch
git checkout --orphan temp_branch
# Add files to new branch
git add -A
git commit -m "Initial commit"
# Delete original master branch
git branch -D master
# Rename orphan branch
git branch -m master
# Push changes (if necessary)
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment