Given the following situation:
A software project is released as open-source under a non-invasive license (e.g., BSD 2/3 clause, Apache 2, ...). During the process, the entire Git repository is made available to the community, which includes the source-code history.
During development (pre-release) as third-party library was used. This library is licensed under GPL 2 (with "copy-left"). In a later development phase the third-party dependency was removed. - Nevertheless, the Git history (partially) contains the library's source code and our own code using it.
The question is: Does this project violates GPL? - And if so, what are the necessary steps to avoid any conflicts/legal issues during open-sourcing (preferably without losing the repository history)?