Basically i added the env/
by mistake and committed then noticed once the push was taking forever and quickly stopped it.
How can i undo my env/
add?
Basically i added the env/
by mistake and committed then noticed once the push was taking forever and quickly stopped it.
How can i undo my env/
add?
If you interrupted the push, the odds are the remote wasn't updated; but the first thing to do is to verify that (and make sure the remote is in a consistent state). I'd expect it to probably be ok, but at least I'd do a simple check. For example, if you were pushing to master
you could
git fetch
git log origin/master
and make sure it is still pointed to a commit that doesn't include your changes.
If that's good, then you can safely edit the history of your local branch and then re-dp the push.
If only the most recent commit was affected, you can
git rm --cached -r env
git commit --amend
If earlier commits were also affected, then you might want to use git filter-branch
with an index-filter
. This is a little more involved, so you'd want to consult the git filter-branch
docs (which spell out examples of solving problems just like this).