# Deleting the relationship under a where clause

**URL:** <https://community.neo4j.com/t/deleting-the-relationship-under-a-where-clause/52527>\
**Category:** Cypher\
**Created:** [February 25, 2022, 9:08am UTC](https://community.neo4j.com/t/deleting-the-relationship-under-a-where-clause/52527 "2022-02-25T09:08:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shubham/32/3828_2.png) [@shubham](https://community.neo4j.com/u/shubham)\
**Post date:** [February 25, 2022, 9:08am UTC](https://community.neo4j.com/t/deleting-the-relationship-under-a-where-clause/52527/1 "2022-02-25T09:08:22Z")

</div>

Hi every one

`match(c)-[x:InteractsWith]-(p) where p.poster is null delete x`

i have executed the above query expecting only the relationship with the clause will be deleted but turned out it deleted all the relationship, any idea if i can undo that?  
thanks in advance

---

<div class="post-metadata">

**Author:** ![shubham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shubham/32/3828_2.png) [@shubham](https://community.neo4j.com/u/shubham)\
**Post date:** [February 25, 2022, 10:03am UTC](https://community.neo4j.com/t/deleting-the-relationship-under-a-where-clause/52527/2 "2022-02-25T10:03:54Z")

</div>

the possible reason it deleted all the relationship is i forgot to add the arrows (direction) so i just want to know if there is any way we can undo it?
