↪️ Undo a git push by removing the commit and going back to the commit before it.
MIT License
Undo a git push by removing the commit and going back to the commit before it.
⚠️ warning!: Double check before running. This action removes commit. You may lose data.
copy and commit this to .github/workflows/undo-push.yml
in your default branch of your repository.
name: Manual Undo Push Action
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to undo commit'
required: true
default: 'master'
jobs:
Undo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Undo Push
uses: exions/undo-push@v1
with:
branch: ${{ github.event.inputs.branch }}
Add file
> Create new file
.github/workflows/undo-push.yml
This action can trigger manually as needed. To undo your push,
Actions
at the top of your Github repositoryManual Undo Push Action
(or other name you have given) under All workflows
Run workflow
, click on itRun workflow