Skip to content

Instantly share code, notes, and snippets.

@mbektchiev
Last active March 19, 2019 19:45
Show Gist options
  • Select an option

  • Save mbektchiev/b017394d633341112e6e to your computer and use it in GitHub Desktop.

Select an option

Save mbektchiev/b017394d633341112e6e to your computer and use it in GitHub Desktop.
Recover forced/deleted branches
// events per repo:
curl https://api.github.com/repos/Icenium/Ice/events?page=1 -u mbektchiev
// events per user:
curl https://api.github.com/users/mbektchiev/events?page=1 -u mbektchiev
// Create a new branch pointing at specified commit SHA:
curl -i -X POST https://api.github.com/repos/Icenium/Ice/git/refs -u mbektchiev -H "Content-Type: application/json" -d '{"ref":"refs/heads/bektchiev/recover2", "sha":"08b58ffdfc4fa57afad636dadc44692fe26fdc76"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment