Reputation: 324
I'm currently working on a project with Github on a private repository.
I made a mistake last friday while pushing my code on my repo and I would like to delete 2 specifics lines (which contains sentsitive information)
I would like to know if it is possible to delete 2 lines (number 458 / 459 on a specific file) from the history, which would mean no trace at all from these information ?
I tried multiple stuff but it never worked and since I pushed more changes, so my commit is behind other.
Is there any way to do so ?
Thank's !
Upvotes: 1
Views: 1271
Reputation: 10996
I suppose you have just pushed to the remote, so:
git log
to retrieve the commit hash, which we will label as COMMIT_HASH.git rebase -i COMMIT_HASH~1
.git add --all
.git rebase --continue
.git push --force
.Upvotes: 4