---
title: "دفع commit سابق قسرًا إلى المستودع"
description: "إذا دفعتم بعض الكود وأردتم دفع commit سابق قسرًا، فيمكنكم ذلك باستخدام git push origin +commit_sha^:branch_name"
canonical: https://oozou.com/til/force-push-previous-commit-to-repo-44
locale: ar
date: 2020-10-13
topic: shell
---

# دفع commit سابق قسرًا إلى المستودع

> إذا دفعتم بعض الكود وأردتم دفع commit سابق قسرًا، فيمكنكم ذلك باستخدام git push origin +commit_sha^:branch_name

Published: 2020-10-13 · Topic: [shell](https://oozou.com/ar/til-topics/shell) ([markdown](https://oozou.com/ar/til-topics/shell.md))

إذا دفعتم بعض الكود وأردتم دفع commit سابق قسرًا، فيمكنكم ذلك باستخدام
*shell
git push origin +commit\_sha^:branch\_name*

حيث يفسّر git الرمز *sha^* على أنه الأصل (parent) لـ *sha*، والرمز *+* على أنه دفع قسري من نوع non-fastforward.

يمكنكم أيضًا استخدام *HEAD^* حيث يمثل *^* الأصل لـ *HEAD*، وبالتالي فإن *HEAD^^^* سيدفع الـ commit الذي يسبق الـ commit الحالي بثلاثة commits.
مثال:
*shell
git push origin +HEAD^^^:feature/i\_did\_an\_oopsie*

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/ar/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
