DEV Community

vinhbuihd
vinhbuihd

Posted on

Làm thế nào để xóa commit đã push ?

Git được sinh ra để giải quyết vấn đề làm việc nhóm. Mỗi commit trong git như một cam kết và rất khó để xóa được chúng nếu đã đẩy lên remote. Tuy nhiên bạn có thể áp dụng các force push

# Trở về commit trước đó
$ git reset HEAD~1

# Force push lại toàn bộ commit trước đó
$ git push --force
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️