➥ Moved to https://github.com/exions/undo-push
Revert a git push by going back 1 commit before.
copy and commit this to .github/workflows/revert-commit.yml
in your repository.
name: Manual Revert Push Action
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to revert latest commit'
required: true
default: 'master'
jobs:
revert:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Revert Push
uses: lcenchew/revert-push@v1
with:
branch: ${{ github.event.inputs.branch }}
Add file
>Create new file
- Name it
.github/workflows/revert-commit.yml
- Commit changes.
This action is trigger manually. To revert your push,
- Go to
Actions
at the top of your Github repository - Click on
Manual Revert Push Action
(or other name you have given) underAll workflows
- You will see
Run workflow
, click on it - Fill in the brach to revert (
⚠️ make sure it is correct) - Click
Run workflow
- Check your branch commit history