G
G
GotLib12021-07-17 18:39:56
git
GotLib1, 2021-07-17 18:39:56

How to undo a git push done?

I am quite new to working with GitHub. We need it with a friend so far only to send the code to each other. Foolishly, I did a git push, like even a couple of times. The files have been replaced with old files from the Github repository. As I understand it, all this time I have been working in the main branch, which I call main. Tried to do git fetch -all, nothing changed.
Question: How can I roll back?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mavolio-Bent, 2021-07-17
@Mavolio-Bent

You
can also check here:
git-revert - Revert some existing commits
git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[]] ...
..
.commits to revert . For a more complete list of ways to spell commit
names, see gitrevisions(7). Sets of commits can also be given but
no traversal is done by default, see git-rev-list(1) and its
--no-walk option.
and other flags via git --help revert

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question